如何设置已安装R包的库位置

时间:2012-11-30 08:42:59

标签: r package

我的问题是我在R终端安装的包路径与我在R-studio中安装的路径不同。所以我想更改安装位置。我怎样才能做到这一点 ?感谢

1 个答案:

答案 0 :(得分:0)

R终端:

您可以将lib参数传递给指定库位置的install.packages。 见?install.packages

 lib: character vector giving the library directories where to
      install the packages.  Recycled as needed.  If missing,
      defaults to the first element of ‘.libPaths()’.

<强> Rstudio:

如果你去工具 - &gt;安装包,您可以在对话框中指定安装包的位置。