Error in installing car package in R - r

While installing "car" package in Rstudio in Ubuntu, I faced an error saying that dependencies "nloptr","lme4" and one more, are not installed.
So I started installing "nloptr" but I faced this error-
configure: Need to download and build NLopt
trying URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz'
Error in download.file(url = "http://ab-initio.mit.edu/nlopt/nlopt-
2.4.2.tar.gz", :
cannot open URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz'
Execution halted
/bin/tar: This does not look like a tar archive
gzip: stdin: unexpected end of file
/bin/tar: Child returned status 1
/bin/tar: Error is not recoverable: exiting now
Warning message:
In untar(tarfile = "nlopt-2.4.2.tar.gz") :
'/bin/tar -xf 'nlopt-2.4.2.tar.gz'' returned error code 2
configure: Starting to install library to
/tmp/RtmpSeLv7g/R.INSTALL18a67910d582/nloptr/nlopt-2.4.2
./configure: line 3325: cd: nlopt-2.4.2: No such file or directory
System hangs after last line and when I restart after some time, "nloptr" is not installed and hence I am unable to install "car" package.
Please help me. Thanks in advance.

I was encountering the same problem under R (pure R 3.2.3 on Linux Debian). I was first blocked by another issue during the same installation : the installation process failed to lock directory ~/.../R/x86_64.../3.2 and suggested to remove ~/.../R/x86_64.../3.2/00LOCK-nloptr . I did it, restart the car package installation, and then it blocked at the same point: it needs nlopt.h.
So, I installed libnlopt-dev (sudo apt-get install libnlopt-dev) and re-restart the car installation ... and then it worked.
Ok, this is under linux, but perhaps should you try to focus on installing something about NLOPT under windows.
Good luck.

Related

Problem with installing RQDA package since it was archived 20/05/2020

I receive an error when installing RQDA on Windows 10.
I had run RQDA successfully, then a package wouldn't load and I deleted and tried to reinstall RQDA with these instructions: http://rqda.r-forge.r-project.org/.
Since then, I receive errors pointing towards RGtk2 and GTK+.
I tried loading RQDA both using the newest and older versions of R and RStudio. I tried on 3 different Windows computers.
Here is the link that shows the RQDA package was recently archived:
https://cran.r-project.org/web/packages/RQDA/index.html
The archive points towards requiring gWidgets, so I made sure the library of gWidgets loads successfully, which it does, as does library(gWidgetsRGtk2).
I also took care to install RTools4.0 for R 4.0.0 (https://cran.r-project.org/bin/windows/Rtools/).
I made sure GTK+ is on my PATH. (Path: %GTK_BASEPATH%\bin;) (GTK_PATH: C:\GTK).
I also tried loading RQDA and dependencies manually, but that's a never ending process.
Here is the error I receive:
Failed to load RGtk2 dynamic library, attempting to install it.
Please install GTK+ from http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip
If the package still does not load, please ensure that GTK+ is installed and that it is on your PATH environment variable
IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN
Error in getOption("encoding") : Knotenstack-Überlauf
Zusätzlich: Warnmeldung:
Failed to load RGtk2 dynamic library, attempting to install it.
Please install GTK+ from http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip
If the package still does not load, please ensure that GTK+ is installed and that it is on your PATH environment variable
IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN
Error: package or namespace load failed for 'RGtk2':
.onLoad in loadNamespace() für 'RGtk2' fehlgeschlagen, Details:
Aufruf: NULL
Fehler: Knotenstack-Überlauf
Fehler: Paket 'RGtk2' konnte nicht geladen werden
Zusätzlich: Warnmeldung:
Failed to load RGtk2 dynamic library, attempting to install it.
Ausführung angehalten
ERROR: lazy loading failed for package 'RQDA'
* removing 'C:/Users/haunschild/Documents/R/win-library/4.0/RQDA'
Warning in install.packages :
installation of package ‘RQDA_0.3-1.tar.gz’ had non-zero exit status
Trying to install RGtk2, I receive the following:
Error in inDL(x, as.logical(local), as.logical(now), ...) :
kann shared object 'C:/Users/haunschild/Documents/R/win-library/4.0/RGtk2/libs/x64/RGtk2.dll' nicht laden:
LoadLibrary failure: %1 ist keine zulässige Win32-Anwendung.
versuche URL 'http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip'
Content type 'application/zip' length 25830230 bytes (24.6 MB)
downloaded 24.6 MB
Learn more about GTK+ at http://www.gtk.org
If the package still does not load, please ensure that GTK+ is installed and that it is on your PATH environment variable
IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN
Lade nötiges Paket: cairoDevice
Warnmeldungen:
1: Failed to load RGtk2 dynamic library, attempting to install it.
2: In dir.create(config_path, recursive = TRUE) :
'C:\Users\haunschild\Documents\R\win-library\4.0\RGtk2\gtk\x64\etc\gtk-2.0' existiert bereits
> detach("package:RGtk2", unload = TRUE)
Fehler: Paket ‘RGtk2’ wird von ‘gWidgetsRGtk2’ benötigt, wird deshalb nicht detached ("Is needed by gWidgetsRGTk2', is therefore not detached")
> library(RGtk2)
I also tried:
pkgFile <- "RQDA_0.3-1.tar.gz"
download.file(url = url, destfile = pkgFile)
# Install dependencies
install.packages(c("DBI","RSQLite","RGtk2","gWidgets","gWidgetsRGtk2"))
# Install package
install.packages(pkgs=pkgFile, type="source", repos=NULL)
# Delete package tarball
unlink(pkgFile)
An received the same RGTk2 error loop.
Any help would be greatly appreciated! Thanks!
I've got RQDA working in Windows after:
install.packages(c("gWidgets", "RGtk2", "igraph","plogr","bit","RSQLite"),depen=T)
To install "gWidgetsRGtk2" it was needed:
Download GTK+: http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.22/gtk+-bundle_2.22.1-20101227_win32.zip
Create an empty folder like c:\opt\
Unzip the content of that file in the folder created. You'll have something like c:\opt\gtk+-bundle_2.22.1-20101227_win32. The name of this folder can be changed.
Then add c:\opt\gtk+-bundle_2.22.1-20101227_win32\bin to your PATH
To add the bin folder to the PATH: right-click on "My Computer" and select "Properties", then "Advanced" tab, then "Environment Variables". Select the "PATH" variable and then "Edit" Add "c:\opt\gtk+-bundle_2.22.1-20101227_win32\bin" to the items in the PATH variable.
PS. Make sure you have no other versions of GTK+ in PATH.
So You can run the following code:
url <- "https://cran.r-project.org/src/contrib/Archive/gWidgetsRGtk2/gWidgetsRGtk2_0.0-86.tar.gz"
pkgFile <- "gWidgetsRGtk2_0.0-86.tar.gz"
download.file(url = url, destfile = pkgFile)
install.packages(pkgs=pkgFile, type="source", repos=NULL)
Once the "gWidgetsRGtk2" is installed, you can run the following command to install RQDA:
install.packages("RQDA",repos="http://R-Forge.R-project.org", type="source")
REFERENCES
https://rqda.r-forge.r-project.org/
https://github.com/krlmlr/r-appveyor/issues/48
We've been discussing this issue at : https://github.com/Ronggui/RQDA/issues/38
Some have reported success installing it and have given feedback on how to do it.
Some contributors are working to port RQDA to gWidgets2. May be one of their solutions works for you.
Good luck.
After I gave the answer above I tryed to install it my self and this was as far as I've got using RKWard 0.7.1b, on VM with MsWins10.
https://rkward.kde.org/
with R 3.6.3 in RKWard library (I had RQDA working before. So I uninstalled RKWard and deleted the library directory on C:\Program Files):
https://cran.r-project.org/bin/windows/base/old/3.6.3
and RTools35
https://cran.r-project.org/bin/windows/Rtools/history.html
also installed.
install.packages(c("gWidgets", "gWidgetsRGtk2", "RGtk2", "igraph","plogr","bit","RSQLite"),depen=T)
update.packages(ask = FALSE, checkBuilt = TRUE)
library(RGtk2)
Selected GTK+
Restarted RKWard
Installing ""RQDA_0.3-1.tar.gz", type = "source"", gave me an error: "Failed to load RGtk2 dynamic library, attempting to install it". But by chance, I just saw the post by #JanMarvin and it worked!!!
install.packages("https://cran.r-project.org/src/contrib/Archive/RQDA/RQDA_0.3-1.tar.gz", type = "source", INSTALL_opts = "--no-multiarch")
Then I ran:
update.packages(ask = FALSE, checkBuilt = TRUE)
And then
library (RQDA)
And it worked!!
If anyone could please refine it or give other suggestions as how to install it on MsWin, would be very much appreciated!
Thanks to #sjewo and #JanMarvin for their hard work!! porting this package to R 4.
These steps update the previous to install RQDA. I'm using Windows 10, and this code was run on April-17, 2021:
Use R version 3.6.3, 32 bits. If possible, also install Rstudio;
Run install.packages("gWidgets", repos="http://R-Forge.R-project.org");
Run install.packages(c("RGtk2","igraph","plogr","bit","RSQLite","cairoDevice"),depen=T);
Run library("RGtk2") . An error message will appear, asking you to install GTK+. Select it and press OK;
Restart R. Then run library("RGtk2") again to see if everything is OK;
Create the folder C:\GTK;
Go to https://download.gnome.org/binaries/win32/gtk+/2.22/ and download the file gtk+-bundle_2.22.1-20101227_win32.zip in C:\GTK;
Unpack the downloaded file in C:\GTK;
Go to the System environment and add to system variables C:\GTK\bin to your PATH;
Restart Windows;
Run the following code:
url <- "https://cran.r-project.org/src/contrib/Archive/gWidgetsRGtk2/gWidgetsRGtk2_0.0-86.1.tar.gz"
pkgFile <- "gWidgetsRGtk2_0.0-86.1.tar.gz"
download.file(url = url, destfile = pkgFile)
install.packages(pkgs=pkgFile, type="source", repos=NULL);
Finally, run install.packages("RQDA",repos="http://R-Forge.R-project.org", type="source");
Enjoy!!!
FWIW, I've written a package called RQDAassist that I and my team use to help with RQDA, including installing the CRAN archive on R 4.0. Check it out and if there's any problem, do post an issue. To do the step-wise installation of RQDA
RQDAassist::install()
That's it.
Also, I noticed that active development is ongoing by RQDA maintainers, so I expect (hope) this issue to be resolved soon.

Installing R Interface for Ipopt

I have exactly the same problem as the poster here, unfortunately no solution is provided on that link.
I built and installed IPOPT (version 3.12.6) on Windows 7 (64bit) with Cygwin, but I cannot seem to get the R interface to work. All commands (configure, make, make install, make test) were executed without error.
When I try to build the R interface from RStudio, I tried using both the code in the "build" folder as well as the code in the main directory. I get the following errors:
`>install.packages("C:/cygwin64/home/Ipopt-3.12.6/build/Ipopt/contrib/RInterface",
repos=NULL, type="source")
Error:
cygwin64/home/Ipopt-3.12.6/build/Ipopt/contrib/RInterface/DESCRIPTION'
Not using the build directory:
`>install.packages("C:/cygwin64/home/Ipopt-3.12.6/Ipopt/contrib/RInterface", repos=NULL, type="source")
Error:
installing source package 'ipoptr' ...
** libs
*** arch - i386 Warning: running command 'make -f "Makevars.win" -f "C:/Users/~1/DOCUME~1/R/R-33~1.1/etc/i386/Makeconf" -f
"C:/Users/~1/DOCUME~1/R/R-33~1.1/share/make/winshlib.mk"
SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)'
SHLIB="ipoptr.dll" ' had status 127 ERROR: compilation failed for
package 'ipoptr'
* removing 'C:/Users/Documents/R/R-3.3.1/library/ipoptr' Warning in install.packages : running command
'"C:/Users/~1/DOCUME~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l
"C:\Users\Documents\R\R-3.3.1\library"
"C:/cygwin64/home/Ipopt-3.12.6/Ipopt/contrib/RInterface"' had status 1
Warning in install.packages : installation of package
‘C:/cygwin64/home/Ipopt-3.12.6/Ipopt/contrib/RInterface’ had non-zero
exit status
Does anyone know what I could do to resolve this?
EDIT: After installing RTools and adding it to my PATH I get ipoptr.cpp:22:34: fatal error: IpIpoptApplication.hpp: No such file or directory
#include "IpIpoptApplication.hpp", i.e. it seems that ipoptr.cpp cannot find IpIpoptApplication.hpp (which is in a subdirectory of the build folder) and later on in the error still the same Warning: running command 'make -f "Makevars.win" -f ' had status 2.... Copying this file over to the location of ipoptr.cpp moves the error one file further to another similar file that it cannot find. I suspect it cannot find these files because of something being wrong with my makevars.win file (I suspect that that's the file that should point to the currently missing files). Does anyone have an idea what this could be?
EDIT 2: Might it have to do with the comment here indicating that in some cases LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$IPOPTDIR/build/lib should be set? How do I do this? Should this be done in R or cygwin?

How to install R-packages not in the conda repositories?

I am using Anaconda to manage my R-installation. It works great for packages available in the R-channels provided by Anaconda, but I am having troubles installing packages not contained in the Anaconda repos.
I have tried a few different approaches, all listed below together with their error output.
1. install.packages('rafalib')
Suggested to work here conda - How to install R packages that are not available in "R-essentials"?. My .libPaths() points to '/home/user/anaconda2/lib/R/library'.
Out:
--- Please select a CRAN mirror for use in this session ---
Error in download.file(url, destfile = f, quiet = TRUE) :
unsupported URL scheme
Error: .onLoad failed in loadNamespace() for 'tcltk', details:
call: fun(libname, pkgname)
error: Can't find a usable init.tcl in the following directories:
/opt/anaconda1anaconda2anaconda3/lib/tcl8.5 ./lib/tcl8.5 ./lib/tcl8.5 ./library ./library ./tcl8.5.18/library ./tcl8.5.18/library
This probably means that Tcl wasn't installed properly.
I installed tcl from the conda channel r-old, but install.packages() still threw the same error message.
2. options(menu.graphics=FALSE) and then install.packages('rafalib')
I got a list of mirrors and chose one.
Out:
Selection: 15
trying URL 'http://cran.utstat.utoronto.ca/src/contrib/rafalib_1.0.0.tar.gz'
Content type 'application/x-gzip' length 11798 bytes (11 KB)
==================================================
downloaded 11 KB
sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook
The downloaded source packages are in
‘/tmp/Rtmphwpta0/downloaded_packages’
Warning message:
In install.packages("rafalib") :
installation of package ‘rafalib’ had non-zero exit status
Both 2 and 3 are from Disable/suppress tcltk popup for CRAN mirror selection in R
3. Setting the mirror in ~/.Rprofile
Before trying install.packages(), I added the following to my ~/.Rprofile.
## Default repo
local({r <- getOption("repos");
r["CRAN"] <- "http://cran.us.r-project.org";
options(repos=r)})
Out:
trying URL 'http://cran.us.r-project.org/src/contrib/rafalib_1.0.0.tar.gz'
Content type 'application/x-gzip' length 11798 bytes (11 KB)
==================================================
downloaded 11 KB
sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook
The downloaded source packages are in
‘/tmp/RtmppIz9rT/downloaded_packages’
Warning message:
In install.packages("rafalib") :
installation of package ‘rafalib’ had non-zero exit status
4. Setting the download method to 'curl' or 'wget'.
While keeping the new ~/.Rprofile configuration. I guess this wasn't necessary since the package seems to be downloading fine now, but I tested it just in case.
Out:
sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook
Warning in download.packages(pkgs, destdir = tmpd, available = available, :
download of package ‘rafalib’ failed
Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
download had nonzero exit status
5. Manual download of rafalib
install.packages('../Downloads/rafalib_1.0.0.tar.gz', repos=NULL, type='source')
Out:
sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook
Warning message:
In install.packages("../Downloads/rafalib_1.0.0.tar.gz", repos = NULL, :
installation of package ‘../Downloads/rafalib_1.0.0.tar.gz’ had non-zero exit status
6. Building a conda package from rafalib
I opened a separate issue for this Errors building R-packages for conda. In short, it complains about missing dependencies that I already have installed. Update I got a round the dependency problem and I am now stuck at the same rl_signal_event_hook-error as for my other approaches.
7. sudo ln /usr/lib/libncursesw.so.6 /usr/lib/libncursesw.so.5
As per https://github.com/conda/conda/issues/1679, but it didn't fix the issue for me.
So it seems like I can now download the package fine, but installing it fails. I have seen the error message sh: symbol lookup error: sh: undefined symbol: rl_signal_event_hook previously when using R with irkernel in the Jupyter Notebook, but it has never obstructed my work. I have never seen anything relating to that error message when running python through anaconda.
I'm out of ideas. Does anyone know how I can install R-packages not provided by anaconda, such as rafalib or swirl?
I am on Linux (Antergos, an Arch derivative) with kernel 4.4.5-1-ARCH.
UPDATE 2016/04/15
There is some related discussion in this thread. I have tried to get around this error by installing different versions of ncurses, including this patched version, and I have tried to link the readline libraries, as suggested here, but I keep running into the same error. I'm quite lost at this point and any help to solve this would be greatly appreciated.
Detailed post on managing packages that are and are not in Anaconda R: http://ihrke.github.io/conda.html
Essentially is using commands:
conda skeleton cran <package_name>
conda build <package_name>
If the package has dependencies that are also not in Anaconda:
conda skeleton cran <dependency1>
conda skeleton cran <dependency2>
conda build <package_name>
Essentially I would agree with this post in saying that I don't understand how install.packages() works with Anaconda. What I seem to see is that Anaconda creates a R environment where all the packages installed from install.packages() are kept.
Whenever I am working in Jupyter with R, I use this environment and am able to access all the packages that I have installed with install.packages()
In the end, I got around the rl_event_hookproblems by following the approach recommended here and symlinking anaconda's libreadline to the system one:
mv ~/anaconda3/lib/libreadline.s.6.2 ~/anaconda3/lib/libreadline.s.6.2.bak
ln -s /usr/lib/libreadline.so.6.3 ~/anaconda3/lib/libreadline.s.6.2
I am still having troubles installing some dependency heavy R-packages due to failure to load shared objects when using install.packages() from withing R. However, simpler packages work fine and I can get most of the dependency heavy packages from anacondas R-repositories.

Error installing RMySQL

It took a good amount of time to install RMySQL on my Linux machine but I was able to install it after changing environment variables and copy and paste lib.dll file.
However, I'm now trying to install RMySQL on my 64bit window machine, but so far there's no progress yet for two days. It broke down after "running command sh ./configure.win had status 127 error, and I cannot find what this means.
Can anyone shed some lights on this?
install.packages('RMySQL',type='source')
Installing package into ‘C:/Users/chu/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/RMySQL_0.9-3.tar.gz'
Content type 'application/x-gzip' length 165363 bytes (161 Kb)
opened URL
downloaded 161 Kb
* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
Warning: running command 'sh ./configure.win' had status 127
ERROR: configuration failed for package 'RMySQL'
* removing 'C:/Users/chu/Documents/R/win-library/3.1/RMySQL'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\chu\Documents\R\win-library\3.1" C:\Users\chu\AppData\Local\Temp\RtmpKA9e7I/downloaded_packages/RMySQL_0.9-3.tar.gz' had status 1
Warning in install.packages :
installation of package ‘RMySQL’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\chu\AppData\Local\Temp\RtmpKA9e7I\downloaded_packages’
for linux users..
install- libmysql first
sudo apt-get install libmysql++-dev
then try.
I was facing the same error. Given below is the link to a way around that worked for me.
http://www.ahschulz.de/2013/07/23/installing-rmysql-under-windows/
In short, the location of library libmysqll.dll required for compilation, had to be changed from lib folder to bin folder of the home directory set for MySQL in environment variables.
By default, R uses the /tmp directory to install packages. On security conscious machines, the /tmp directory is often marked as “noexec” in the /etc/fstab file. This means that no file under /tmp can ever be executed. Packages that require compilation or that have self-inflating data will fail with the error mentioned.
The solution is to set the TMPDIR environment variable outside R (in your shell), which R will use as the compilation directory. How to do this depends on the shell. bash:
mkdir ~/tmp
export TMPDIR=~/tmp
Then R can compile and install the package.
I ran into the same problem while updating packages on Windows server for latest version of R. I solved it by installing from a .zip file vs .tar.gz.
I actually had to go through the process of first downloading the package, and then installing from it (not from mirror) for other reasons.
Here is what it looked like:
pk <- 'caTools'
download.packages(pk, "R-3.2-packages/" ,type = "win.binary")
install.packages(
dir("R-3.2-packages/",pattern=pk,full.names = TRUE),
repos = NULL,
type = "source")
Hope this helps.
Solution if anyone faced the same problem on windows:
Make sure your MYSQL_HOME environment variable is set correctly and libmysql.dll is copied to bin folder!!!
Run install.packages('RMySQL') then when the "Do you want to install from sources..." window pops up select No.
Then copy the downloaded binary packages location from console.
Go to Packages -> Install, paste the location into Package archive and click Install.

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
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.
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

Resources