gpt4 book ai didi

r - 将 R 包安装到特定目录

转载 作者:行者123 更新时间:2023-12-04 11:24:15 24 4
gpt4 key购买 nike

我尝试使用此代码将 R 包安装到我存储 R 包的目录中。

install.packages("zoo", lib="/data/Rpackages/")

我收到此警告消息:

Warning in install.packages("zoo", lib = "/data/Rpackages/") : 'lib = "/data/Rpackages/"' is not writable



其次我如何创建文件 .Renviron在我们的家乡区域并添加行 R_LIBS=/data/Rpackages/要吗?

最佳答案

您如何真正摆脱警告情况?除了(在 R Studio 菜单中)Session->Interrupt R 并终止 R session 之外,还有更好的方法吗?我试过CTRL-C。

> install.packages("car", lib="/my R packages/")
Warning in install.packages :
'lib = "/my R packages/"' is not writable

我对这个问题的解决方案是使用“包”窗口在 R Studio 中加载包,然后执行以下操作:
> install.packages("car")
Installing package into ‘C:/Users/33386/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/car_2.0-21.zip'
Content type 'application/zip' length 1332800 bytes (1.3 Mb)
opened URL
downloaded 1.3 Mb

package ‘car’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\33386\AppData\Local\Temp\RtmpKWnZD4\downloaded_packages
>

关于r - 将 R 包安装到特定目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24016632/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com