Error while installing R packages - r

While trying to install the 'Rook' package in R i'm getting the following error:
** package ‘Rook’ successfully unpacked and MD5 sums checked
** libs
sh: 1: -f: not found
ERROR: compilation failed for package ‘Rook’
* removing ‘/usr/lib/R/site-library/Rook’
The downloaded packages are in
‘/tmp/RtmpPW6kC2/downloaded_packages’
Warning message:
In install.packages("Rook", repos = "http://cran.r-project.org") :
installation of package ‘Rook’ had non-zero exit status
I used both the install.packages() function and the terminal to install the package, but received the same message. Any ideas?
OS: Ubuntu 12.04.

Related

How to install gpclib?

I get the following trying to install gpclib package in R 3.6.2:
Package which is only available in source form, and may need
compilation of C/C++/Fortran: ‘gpclib’
These will not be installed
I have already installed Rtools.
I tried with the code:
install.packages("gpclib")
Trying with
install.packages("gpclib", type="source")
the message is:
installing *source package 'gpclib' ...
** package 'gpclib' successfully unpacked and MD5 sums checked **
using staged installation ** libs *** arch - i386 Warning in system(cmd) :
'make' not found ERROR: compilation failed for package 'gpclib' *
removing 'C:/Users/Juan/Documents/R/win-library/3.6/gpclib'
Warning message: In install.packages("gpclib", type = "source") :
installation of package ‘gpclib’ had non-zero exit status*

R: Error when installing archived package manually

I am trying to install an archived R package, SciencesPo, but it's not installing, even after installing the dependencies. The following is the code and the messages that follow
install.packages("C:\Users\Overman\Downloads\SciencesPo_1.4.1.tar.gz", repos = NULL, type = "source")
Installing package into ‘C:/Users/Overman/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
* installing source package 'SciencesPo' ...
** package 'SciencesPo' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'SciencesPo'
* removing 'C:/Users/Overman/Documents/R/win-library/3.5/SciencesPo'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘C:/Users/Overman/Downloads/SciencesPo_1.4.1.tar.gz’ had non-zero exit status
Installing Rtools solved the problem.

Warning: running command 'sh ./configure.win' had status 127

I was trying to install package "stringi" using install.packages() but ran into the following errors:
PackDirB="C:\\Users\\PC\\Documents\\R\\win-library\\3.2\\stringi_0.5-5.tar.gz"
> install.packages(PackDirB, repos=NULL, type="source")
Installing package into ‘C:/Users/PC/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
* installing *source* package 'stringi' ...
** package 'stringi' successfully unpacked and MD5 sums checked
Warning: running command 'sh ./configure.win' had status 127
ERROR: configuration failed for package 'stringi'
* removing 'C:/Users/Santos/Documents/R/win-library/3.2/stringi'
Warning messages:
1: running command '"C:/PROGRA~1/R/R-32~1.1/bin/x64/R" CMD INSTALL -l
"C:\Users\PC\Documents\R\win-library\3.2" "C:/Users/PC/Documents/R/win-library/3.2/stringi_0.5-5.tar.gz"' had status 1
2: In install.packages(PackDirB, repos = NULL, type = "source") :
installation of package ‘C:/Users/PC/Documents/R/win-library/3.2/stringi_0.5-5.tar.gz’ had non-zero exit status
What happened? What am I supposed to do?
You need to have RTools installed. Installing RTools got rid of this error for me.

Error when installing gpclib

R version 3.2.1
I downloaded gpclib_1.5-5.tar.gz from http://cran.r-project.org/web/packages/gpclib/index.html and attempted to install the package with
install.packages("D:/GIS/gpclib_1.5-5.tar.gz", repos = NULL, type = "source")
I get the error
* installing *source* package 'gpclib' ...
** package 'gpclib' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
Warning: running command 'make -f "D:/R/R-3.2.1/etc/i386/Makeconf" -f "D:/R/R-3.2.1/share/make/winshlib.mk" SHLIB="gpclib.dll" OBJECTS="Rgpc.o gpc.o"' had status 127
ERROR: compilation failed for package 'gpclib'
* removing 'D:/R/R-3.2.1/library/gpclib'
Warning in install.packages :
running command '"D:/R/R-3.2.1/bin/x64/R" CMD INSTALL -l "D:\R\R-3.2.1\library" "D:/GIS/gpclib_1.5-5.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘D:/GIS/gpclib_1.5-5.tar.gz’ had non-zero exit status
How do I troubleshoot this?
Extra Information
I am ultimately trying to create heat maps, and am following this tutorial
http://spatialanalysis.co.uk/wp-content/uploads/2013/04/james_cheshire_ggplot_intro_blog.pdf
You'll need to install Rtools to install the R compiler libraries:
http://cran.r-project.org/bin/windows/Rtools/
Otherwise, R will have issues compiling from source code.

R Packages Installation Error on Ubuntu

I am trying to install the R package "colorspace" in Ubuntu Linux from local repository as follows:
install.packages("/home/colorspace_1.2-4.tar.gz", repos = NULL, type="source")
This throws the following error:
Installing package into '/home/vertica/R/x86_64-unknown-linux-gnu-library/3.0'
(as 'lib' is unspecified)
* installing *source* package 'colorspace' ...
** package 'colorspace' successfully unpacked and MD5 sums checked
** libs
sh: make: command not found
ERROR: compilation failed for package 'colorspace'
* removing '/home/vertica/R/x86_64-unknown-linux-gnu-library/3.0/colorspace'
Warning message:
In install.packages("/home/colorspace_1.2-4.tar.gz", :
installation of package '/home/colorspace_1.2-4.tar.gz' had non-zero exit
status
Could someone help me with this issue?
Thank you.
Ravi
Its saying it can't find "make", which makes me think you don't have all the compilers and so on that you need to build packages from source.
Install the "build-essential" package, something like:
sudo apt-get install build-essential
from your command line (not from R!)

Resources