我正在尝试在 RStudio 中安装软件包,但无法做到这一点。安装软件包失败,但出现错误或警告。
我之前在安装 texlive-full 时遇到了问题,并且可能对我的 /etc/apt/sources.list.d 文件做了一些尴尬的事情。我遇到了以下问题:
install.packages('rstanarm')
Warning in install.packages :
unable to access index for repository https://cloud.r-
project.org/src/contrib:
cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES
这在另一个 stackoverflow 线程中得到了解决:无法在最新版本的 RStudio 和 R Version.3.1.1 中安装软件包 https://stackoverflow.com/questions/25599943/unable-to-install-packages-in-latest-version-of-rstudio-and-r-version-3-1-1
运行时:
install.packages('rstanarm', 依赖项 = T, , repos='http://cran.rstudio.com/ http://cran.rstudio.com/')
R 失败并出现错误:
ERROR: failed to lock directory ‘[...]/R/x86_64-pc-linux-gnu-
library/3.6’ for modifying
Try removing ‘[...]/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-
rstanarm’
我再一次在 stackoverflow 中尝试过R install.packages 返回“无法创建锁定目录” https://stackoverflow.com/questions/14382209/r-install-packages-returns-failed-to-create-lock-directory
和跑步
install.packages('rstanarm', dependencies = T, ,
repos='http://cran.rstudio.com/', INSTALL_opts = c('--no-lock'))
导致 RStudio 在安装过程中崩溃并关闭。
其他包也会发生这种情况。我在这上面花了几个小时,濒临放弃。有人知道会发生什么吗?
非常感谢!