1

尝试在 R 中从 Github 安装 Hadley 的 HTTR 包时出现以下错误。

> library(devtools)
> install_github("httr")
Installing github repo(s) httr/master from hadley
Installing httr.zip from https://github.com/hadley/httr/zipball
Installing httr
* checking for file 'C:\Users\btibert\AppData\Local\Temp\RtmpSGjjYA\hadley-httr-ee0eafb/DESCRIPTION' ... OK
* preparing 'httr':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* looking to see if a 'data/datalist' file should be added
Error in if (any(update)) { : missing value where TRUE/FALSE needed
Execution halted
Error: Command failed (1)
In addition: Warning message:
running command '"C:/PROGRA~1/R/R-215~1.0/bin/i386/R" CMD build "C:\Users\btibert\AppData\Local\Temp\RtmpSGjjYA\hadley-httr-ee0eafb" --no-manual --no-vignettes' had status 1 

不知道我的问题是什么。这是我在 Windows 7 上的版本信息:

$platform
[1] "i386-pc-mingw32"

$arch
[1] "i386"

$os
[1] "mingw32"

$system
[1] "i386, mingw32"

$status
[1] ""

$major
[1] "2"

$minor
[1] "15.0"

$year
[1] "2012"

$month
[1] "03"

$day
[1] "30"

$`svn rev`
[1] "58871"

$language
[1] "R"

$version.string
[1] "R version 2.15.0 (2012-03-30)"

$nickname
[1] ""

更新:建议尝试安装 devtools 的开发版本。我收到了这个错误:

> library(devtools)
> install_github("devtools")
Installing github repo(s) devtools/master from hadley
Installing devtools.zip from https://github.com/hadley/devtools/zipball
Installing devtools
* checking for file 'C:\Users\btibert\AppData\Local\Temp\RtmpsbYABm\hadley-devtools-77011a6/DESCRIPTION' ... OK
* preparing 'devtools':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building 'devtools_0.8.tar.gz'
cygwin warning:
  MS-DOS style path detected: C:/Users/btibert/AppData/Local/Temp/RtmpsbYABm/devtools_0.8.tar.gz
  Preferred POSIX equivalent is: /cygdrive/c/Users/btibert/AppData/Local/Temp/RtmpsbYABm/devtools_0.8.tar.gz
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

Warning: invalid package 'Files/R/R-2.15.0/library'
Error: ERROR: cannot cd to directory 'C:/Program'
Error: Command failed (1)
In addition: Warning message:
running command '"C:/PROGRA~1/R/R-215~1.0/bin/i386/R" CMD INSTALL C:\Users\btibert\AppData\Local\Temp\RtmpsbYABm/devtools_0.8.tar.gz --library=C:/Program Files/R/R-2.15.0/library' had status 1 
4

2 回答 2

1

您是否尝试过 devtools 的开发版本?

install_github("devtools")
install_github("httr")

最近有同样的问题,这是修复...

于 2012-09-11T23:13:38.967 回答
-1

试试这个 install.packages("devtools")

否则试试这个并安装所需的包 apt-get -y install libcurl4-gnutls-dev apt-get -y build-dep libcurl4-gnutls-dev

于 2015-02-13T15:54:49.437 回答