无法将 RStudio 编入 HTML 文档
Can't knit an RStudio into an HTML document
我打开了一个 RStudio 会话,需要将其编入 HTML 文档中。我试图通过针织按钮来完成,但我收到一个弹出窗口,上面写着:
Loading required package: knitr
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called ‘knitr’
Error in knit("jorge_perez_ruano_uber_final.Rhtml", encoding = "UTF-8") :
could not find function "knit"
Execution halted
knitr 终止,状态为 1
我已经安装了 markdown 包并尝试 运行 渲染函数,但它给了我另一个错误:
Error in render("path/to/file.Rmd") : could not find function "render"
有人知道如何提供帮助吗?
错误在错误中——你没有安装knitr
。
使用 install.packages("knitr")
安装软件包,您应该可以开始了。请记住,markdown 环境应被视为与全局环境分开,因此您需要在代码块中加载相关库和代码,然后才能访问它。这里有一个很好的introduction to the topic.
我打开了一个 RStudio 会话,需要将其编入 HTML 文档中。我试图通过针织按钮来完成,但我收到一个弹出窗口,上面写着:
Loading required package: knitr Warning message: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called ‘knitr’ Error in knit("jorge_perez_ruano_uber_final.Rhtml", encoding = "UTF-8") : could not find function "knit" Execution halted
knitr 终止,状态为 1
我已经安装了 markdown 包并尝试 运行 渲染函数,但它给了我另一个错误:
Error in render("path/to/file.Rmd") : could not find function "render"
有人知道如何提供帮助吗?
错误在错误中——你没有安装knitr
。
使用 install.packages("knitr")
安装软件包,您应该可以开始了。请记住,markdown 环境应被视为与全局环境分开,因此您需要在代码块中加载相关库和代码,然后才能访问它。这里有一个很好的introduction to the topic.