我的R
安装(在Ubuntu 16.04上运行)突然输出R execution error
并关闭。重新打开会话后(在RStudio
中)我发现R
删除了我计算机上的所有现有软件包(或者更好,再也找不到任何软件包):我试图重新安装除了我尝试安装的软件包之外,我总是得到Error in library(<name>) : there is no package called <name>
。例如:
> install.packages("data.table")
trying URL 'https://cran.rstudio.com/src/contrib/data.table_1.10.4.tar.gz'
Content type 'application/x-gzip' length 3068135 bytes (2.9 MB)
==================================================
downloaded 2.9 MB
Error in library(data.table) : there is no package called ‘data.table’
Execution halted
Warning in install.packages :
installation of package ‘data.table’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmpl1WV2b/downloaded_packages’
同样适用于任何其他人。我已经尝试手动更改CRAN镜像,但它无关紧要。如果我做
> .libPaths()
[1] "/home/user/R/x86_64-pc-linux-gnu-library/3.4"
[2] "/usr/local/lib/R/site-library"
[3] "/usr/lib/R/site-library"
[4] "/usr/lib/R/library"
以上所有都是空的(他们之前没有,现在他们是,似乎一切都被抹去了)。但是
ls -l /tmp/Rtmpl1WV2b/downloaded_packages
total 3000
-rw-rw-r-- 1 user 3068135 Jun 23 04:05 data.table_1.10.4.tar.gz
所以尽管在R中出现错误信息,但是以某种方式将包下载到某处。任何想法在这里发生了什么?