Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing ggbiplot from github

I'm trying to install development version of ggbiplotfrom Github. During installation I'm getting the following error message:

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 

Any idea to figure out this problem. Thanks in advance for your help and time.

Edit

After downloading from Github, also tried

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

which produced this error message

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
like image 663
MYaseen208 Avatar asked Mar 13 '12 00:03

MYaseen208


1 Answers

It's because your Rlib path has a space in it: C:/Users/Muhammad Yasseen/R/win-library/2.14.

See how in the first error log the warning message was

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 

In particular, the --library=C:/Users/Muhammad Yaseen/R/win-library/2.14.

This should be --library="C:/Users/Muhammad Yaseen/R/win-library/2.14" to deal with the space.

Using install.packages takes care of the quotes for you - see how your second warning message (when you used install.packages) was

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 

The -l "C:/Users/Muhammad Yasseen/R/win-library/2.14" has quote marks around it, so you don't get the same error.

I had a quick look at the install-github sources, and it constructs the R CMD INSTALL command via:

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

See how it doesn't surround .libPaths()[1] by double quotes in case of spaces? I'd guess that's your problem.

As to a fix - there seems to be an error using install.packages() on a tar file generated by git (as reported here). So, you can either:

  • change your R library location to somewhere without spaces
  • unzip the .tar.gz file (I don't know what software does this on Windows) and install from the extracted directories rather than the .tar.gz.
like image 188
mathematical.coffee Avatar answered Sep 21 '22 14:09

mathematical.coffee