当我运行以下程序时:
library(devtools)
install_github('roxygen2')
我得到以下错误:
使用devtools 0.51:
Installing roxygen2 from hadley
Error in unzip(src, list = TRUE) :
zip file '/tmp/Rtmp2b44Ug/hadley-roxygen2.zip' cannot be opened
我安装了一个更新版本(0.6)的devtools:install_github('devtools')
错误信息更丰富,但类似:
> install_github('roxygen')
Installing github repo(s) roxygen/master from hadley
Installing roxygen.zip from https://github.com/hadley/roxygen/zipball
Error in expand(src, list = TRUE) :
zip file '/tmp/Rtmp2b44Ug/roxygen.zip' cannot be opened
In addition: Warning message:
In expand(src, exdir = tempdir()) : error 1 in extracting from zip file
我做错什么了吗?
> sessionInfo()
R version 2.14.1 (2011-12-22)
Platform: x86_64-pc-linux-gnu (64-bit)
...
发生此错误是因为函数install_github
默认设置username='hadley'
(请参阅安装github.r-source)
在这种情况下,没有github分支hadley/roxygen
,现在从https://github.com/hadley/roxygen/zipball/master
这将起作用:
install_github('roxygen',username = 'klutometis')
注意:即使包名为roxygen2,"repo"名称也是"roxygen"
我在devtools 中打开了一个错误