1

当我运行以下命令时:

library(devtools)
install_github('roxygen2')

我收到以下错误:

使用开发工具 0.51:

Installing roxygen2 from hadley
Error in unzip(src, list = TRUE) : 
  zip file '/tmp/Rtmp2b44Ug/hadley-roxygen2.zip' cannot be opened

我安装了 devtools 的更新版本(0.6):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)
... 
4

1 回答 1

3

出现此错误是因为该函数默认install_github设置username='hadley'(参见install-github.r 源代码

在这种情况下,没有 github 分支hadley/roxygen,现在从https://github.com/hadley/roxygen/zipball/master下载

这将起作用:

install_github('roxygen',username = 'klutometis')

注意:即使包名为 roxygen2,“repo”名称也是“roxygen”

在 devtools 中打开了一个错误

于 2012-03-13T00:37:58.957 回答