5

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
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
  • The error `ERROR: cannot cd to directory 'C:/Users/Muhammad'` in combination with `invalid package 'Yaseen/R/win-library/2.14'` suggests that the problem is with spaces in your directory path (i.e. `C:/Users/Muhammad Yaseen`). – mathematical.coffee Mar 13 '12 at 01:24
  • @mathematical.coffee: I can install all other packages from CRAN and Github and have only issue with this specific package. Don't know why? Any solution. – MYaseen208 Mar 13 '12 at 01:27
  • It is recommended that you don't have spaces in your R library path or R path. I'd guess something in `install_github` doesn't quote the path to guard against spaces -- see how (in your first error log) it says `"running command ...R CMD INSTALL ... -library=C:/Users/Muhammad Yasseen/..."`, and there are no quotes surrounding the `C:/Users/Muhammad Yasseen/..`? That's the problem. (File paths with spaces should be surrounded by quotes for `R CMD INSTALL`-type commands). – mathematical.coffee Mar 13 '12 at 01:32

2 Answers2

5

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.
mathematical.coffee
  • 55,977
  • 11
  • 154
  • 194
  • Update - reported it [here](https://github.com/hadley/devtools/issues/73), looks like it's been fixed in the latest version (you'd have to install the bleeding edge version of `devtools` though -- you could install `git` and clone the repo directly). – mathematical.coffee Mar 13 '12 at 03:56
0

You can't unzip the .tar.gz because it cleans up that file quicker than you can grab it (I've watched it appear and get deleted again). Correct me if I'm wrong, but I also can't get devtools from github for teh same reason :S