下载 Rcpp 包时出现此错误:
> install.packages("Rcpp", dependencies=TRUE)
Installing package(s) into ‘/home/me/src/Rlibs’ (as ‘lib’ is unspecified)
trying URL 'http://cran.us.r-project.org/src/contrib/Rcpp_0.10.2.tar.gz'
Content type 'application/x-gzip' length 2380089 bytes (2.3 Mb)
...
Warning in dir.create(lockdir, recursive = TRUE) :
cannot create dir '/home', reason 'Permission denied'
ERROR: failed to create lock directory ‘/home/me/src/Rlibs/00LOCK-Rcpp’
...
由于我的机器在计算机集群上,所以我在不同的节点上尝试过,我很小心地删除了/tmp中下载的临时文件。奇怪的是我有权在 /home/me/src/Rlibs/ 中写入。所以我的问题是:
- 为什么 R 想要在 /home 中拥有写入权限,而它只需要 /home/me/ 中的写入权限?
- 我该如何解决这个错误?
> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-redhat-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_2.15.2