从github安装ggbiplot

时间:2012-03-13 00:49:51

标签: r github devtools ggbiplot

我正在尝试从Github安装ggbiplot的开发版本。在安装过程中,我收到以下错误消息:

library(devtools)
install_github("ggbiplot", "vqv")


Installing github repo(s) ggbiplot/master from vqv
Installing ggbiplot.zip from https://github.com/vqv/ggbiplot/zipball
Installing ggbiplot
* checking for file 'C:\Users\Muhammad Yaseen\AppData\Local\Temp\Rtmpsx4n5u\vqv-ggbiplot-2623d7c/DESCRIPTION' ... OK
* preparing 'ggbiplot':
* 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
* building 'ggbiplot_0.5.tar.gz'
cygwin warning:
  MS-DOS style path detected: C:/Users/MUHAMM~1/AppData/Local/Temp/Rtmpsx4n5u/ggbiplot_0.5.tar.gz
  Preferred POSIX equivalent is: /cygdrive/c/Users/MUHAMM~1/AppData/Local/Temp/Rtmpsx4n5u/ggbiplot_0.5.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 'Yaseen/R/win-library/2.14'
Error: ERROR: cannot cd to directory 'C:/Users/Muhammad'
Error: Command failed (1)
In addition: Warning message:
running command '"C:/PROGRA~1/R/R-214~1.2/bin/i386/R" CMD INSTALL C:\Users\MUHAMM~1\AppData\Local\Temp\Rtmpsx4n5u/ggbiplot_0.5.tar.gz --library=C:/Users/Muhammad Yaseen/R/win-library/2.14' had status 1 

想知道这个问题。提前感谢您的帮助和时间。

修改

从Github下载后,也尝试了

install.packages("vqv-ggbiplot-2623d7c.tar.gz", repos=NULL, type="source")

产生了此错误消息

Installing package(s) into ‘C:/Users/Muhammad Yaseen/R/win-library/2.14’
(as ‘lib’ is unspecified)
Error in untar2(tarfile, files, list, exdir) : unsupported entry type 'g'
Warning messages:
1: running command 'C:/PROGRA~1/R/R-214~1.2/bin/i386/R CMD INSTALL -l "C:/Users/Muhammad Yaseen/R/win-library/2.14"   "vqv-ggbiplot-2623d7c.tar.gz"' had status 1 
2: In install.packages("vqv-ggbiplot-2623d7c.tar.gz", repos = NULL,  :
  installation of package ‘vqv-ggbiplot-2623d7c.tar.gz’ had non-zero exit status

2 个答案:

答案 0 :(得分:5)

这是因为你的Rlib路径中有一个空格:C:/Users/Muhammad Yasseen/R/win-library/2.14

在第一个错误日志中查看警告消息是如何

running command '"C:/PROGRA~1/R/R-214~1.2/bin/i386/R" CMD INSTALL 
C:\Users\MUHAMM~1\AppData\Local\Temp\Rtmpsx4n5u/ggbiplot_0.5.tar.gz
--library=C:/Users/Muhammad Yaseen/R/win-library/2.14' 
had status 1 

特别是--library=C:/Users/Muhammad Yaseen/R/win-library/2.14

这应该是--library="C:/Users/Muhammad Yaseen/R/win-library/2.14"来处理空间。

使用install.packages为您处理报价 - 请参阅第二条警告消息(当您使用install.packages时)

running command 'C:/PROGRA~1/R/R-214~1.2/bin/i386/R CMD INSTALL 
-l "C:/Users/Muhammad Yaseen/R/win-library/2.14"   
"vqv-ggbiplot-2623d7c.tar.gz"' had status 1 

-l "C:/Users/Muhammad Yasseen/R/win-library/2.14"周围有引号,所以你不会得到同样的错误。

我快速浏览了install-github来源,并通过以下方式构建R CMD INSTALL命令:

paste("CMD INSTALL ", built_path, " --library=", .libPaths()[1], sep="")

如果是空格,请查看它是如何用双引号括起.libPaths()[1]的?我猜这是你的问题。

关于修复 - 在install.packages()生成的tar文件上使用git似乎有错误(报告为here)。所以,您可以:

  • 将您的R库位置更改为无空格的地方
  • 解压缩.tar.gz文件(我不知道Windows上的软件是什么),并从提取的目录而不是.tar.gz安装。

答案 1 :(得分:0)

你无法解压缩.tar.gz,因为它比你抓住它更快地清理那个文件(我看到它出现并再次被删除)。如果我错了,请纠正我,但由于同样的原因,我也无法从github获得devtools:S