4

我正在尝试从 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将我TMPTMPDIR、 和设置为可写文件夹:TEMP

> Sys.getenv(c("TMP","TEMP","TMPDIR"))
          TMP          TEMP        TMPDIR 
"H:\\R\\temp" "H:\\R\\temp" "H:\\R\\temp"
4

1 回答 1

6

I have got it working, and it was definitely just dumb human error. My working directory was somehow set to a location for which I didn't have write permissions. I setwd() to a folder where I have permissions and it worked just fine. I'm not sure if it was part of the solution, but @hadley's tip about setting the TMP envvar was good, and will be useful in general.

于 2012-10-11T17:18:07.990 回答