更改默认库
有没有办法在Knitr中更改默认库?我得到这个错误:更改默认库
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: could not find function "knit"
Execution halted
我用RStudio和阅读rstudio的支持对这个问题的话题,但我仍然有同样的问题。
好的,我知道我该怎么做。在R/etc中创建文件Renviron.site并包含行R_LIBS = C:/ Program Files/RStudio/R/library。效果很好。
什么操作系统?
您是否知道Rprofile
和Rprofile.site
?
你看过help(Startup)
吗?
为什么您的R安装目录与RStudio使用的目录不同?
Windows 7,我应该如何处理Rprofile和Rprofile.site?我应该在那里改变什么? – Maciej 2012-07-30 18:02:28
你想设置'.libPaths',例如通过类似'.libPaths(c(“c:/ opt/R-library”,.libPaths()))'' - 根据你的库的位置来调整。然后通过调用'libPaths()'来检查R和RStudio,告诉它它的当前值。 – 2012-07-30 18:04:21
R 15.1文件夹中有两个默认库,第二个位于Rstudio文件夹中:“C:/ Program Files/R/R-2.15.1/library”“C:/ Program Files/RStudio/R/library”。 – Maciej 2012-07-30 18:09:51
另一个解决方案是更改.libPaths()的顺序,首先应该是R Studio库。 – Maciej 2012-08-02 07:51:59