当我运行以下内容时:
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)
...
答案 0 :(得分:3)
发生此错误是因为函数install_github
默认设置username='hadley'
(请参阅install-github.r source)
在这种情况下,没有github分支hadley/roxygen
,现在从https://github.com/hadley/roxygen/zipball/master下载
这将有效:
install_github('roxygen',username = 'klutometis')
注意:即使包名为roxygen2,“repo”名称为“roxygen”
我打开了bug in devtools