我尝试从 github 安装软件包,但不断收到以下错误;
"Error in unzip(src, list = TRUE) : 'exdir' does not exist".
我猜测 unzip 没有权限创建解压目录,但我不知道如何将参数传递给 exdir 参数。
> require(devtools)
> install_github("rvertnet", "ropensci")
Installing github repo(s) rvertnet/master from ropensci
Installing rvertnet.zip from https://api.github.com/repos/ropensci/rvertnet/zipball/master
Error in unzip(src, list = TRUE) : 'exdir' does not exist
这是我第一次从 github 安装,所以我可能会遗漏一些非常简单的东西。我确实尝试过其他软件包(ggplot2
)并得到了相同的错误。
编辑:从 sessionInfo()
添加结果:
> sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_Canada.1252 LC_CTYPE=English_Canada.1252 LC_MONETARY=English_Canada.1252
[4] LC_NUMERIC=C LC_TIME=English_Canada.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] devtools_0.8
loaded via a namespace (and not attached):
[1] digest_0.5.2 evaluate_0.4.2 httr_0.1.1 memoise_0.1 parallel_2.15.1 plyr_1.7.1
[7] RCurl_1.91-1.1 stringr_0.6.1 tools_2.15.1 whisker_0.1
我已通过 renviron.site 将我的 TMP
、TMPDIR
和 TEMP
设置为可写文件夹:
> Sys.getenv(c("TMP","TEMP","TMPDIR"))
TMP TEMP TMPDIR
"H:\\R\\temp" "H:\\R\\temp" "H:\\R\\temp"
最佳答案
我已经让它工作了,这绝对只是愚蠢的人为错误。我的工作目录以某种方式设置为我没有写入权限的位置。我 setwd()
到一个我有权限的文件夹,它工作得很好。我不确定它是否是解决方案的一部分,但 @hadley 关于设置 TMP
envvar 的提示很好,并且通常很有用。
关于r - 使用install_github时出错: 'exdir' does not exist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12829100/