3
votes

With R version 3.2.3 (2015-12-10) on centOS I am trying to install.packages('forecast')

I get this:

install.packages('forecast')
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
also installing the dependency ‘RcppArmadillo’

trying URL 'http://mirrors.ebi.ac.uk/CRAN/src/contrib/RcppArmadillo_0.6.700.3.0.tar.gz'

Content type 'application/x-gzip' length 1002967 bytes (979 KB)

downloaded 979 KB

trying URL 'http://mirrors.ebi.ac.uk/CRAN/src/contrib/forecast_7.1.tar.gz'

Content type 'application/x-gzip' length 196896 bytes (192 KB)

downloaded 192 KB

Error in plota.theme(col.border = rgb(68, 68, 68, maxColorValue = 255), :
could not find function "rgb"
Calls: source ... eval -> eval -> plota.theme.green.orange -> plota.theme
Execution halted
Error in plota.theme(col.border = rgb(68, 68, 68, maxColorValue = 255), :
could not find function "rgb"
Calls: source ... eval -> eval -> plota.theme.green.orange -> plota.theme
Execution halted

The downloaded source packages are in
‘/tmp/Rtmp0jOTCu/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("forecast") :
installation of package ‘RcppArmadillo’ had non-zero exit status
2: In install.packages("forecast") :
installation of package ‘forecast’ had non-zero exit status

I tried every solution to fix this like install package from source indicate the dependency = TRUE, etc., but nothing works.

sessionInfo() give this output

R version 3.2.3 (2015-12-10)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS release 6.7 (Final)

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

2
Have you tried installing RcppArmadillo via install.packages("RcppArmadillo")?Roman Luštrik
@RomanLuštrik ..In install.packages("RcppArmadillo") : installation of package ‘RcppArmadillo’ had non-zero exit statusEmad
Maybe relevant post: stackoverflow.com/questions/25721884zx8754
@zx8754 i tried every single answer in that post .Emad
@nrussell first you were right i needed an old version of forecast and all it's dependencies ,, but i couldn't install them because of the script i was runing at the runtime of R ( as we did it in the previous question ) so i deleted them and everything goes fine ,,,,Emad

2 Answers

0
votes

On UBUNTU 18.04 I got the following

Configuration failed because libcurl was not found. Try installing: * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc) * rpm: libcurl-devel (Fedora, CentOS, RHEL) * csw: libcurl_dev (Solaris)

I installed the package libcurl14-openssl-dev using synaptic, that solved the problem.

-2
votes

Install devtools. Most of the time the problem in installing R packages is that these tools are not there. Once this is installed, the zero exit error goes away.

install.packages('devtools')

https://www.digitalocean.com/community/tutorials/how-to-install-r-packages-using-devtools-on-ubuntu-16-04