R install.packages返回“无法创建锁目录". [英] R install.packages returns "failed to create lock directory"
问题描述
下载Rcpp软件包时出现此错误:
I get this error when downloading the Rcpp package:
> 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/中编写.所以我的问题是:
As my machine is on a computer cluster, I've tried it on different nodes, and I was careful to delete the temporary files downloaded in /tmp. What is strange is that I have rights to write in /home/me/src/Rlibs/. So my questions are:
- 为什么R只想在/home/me/中拥有写权限,而又想在/home中具有写权限?
- 如何解决该错误?
> 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
推荐答案
在NFS文件系统上,有时需要关闭哪些内容并不明显.
On NFS file systems it is sometimes not obvious what things you have to close.
避免这种情况的最佳方法是在命令行上使用--no-lock
参数,即:
The best way to avoid this is to use the --no-lock
argument on the command line, i.e.:
R CMD INSTALL --no-lock <pkg>
在R中,您可以使用以下命令在命令中进行操作:
From within R, you can do this from within your command using:
install.packages("Rcpp", dependencies = TRUE, INSTALL_opts = '--no-lock')
这篇关于R install.packages返回“无法创建锁目录".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!