How to install R forecast pack in ubuntu 12.04?

I tried the following code to install

>install.packages("forecast") 

An error occurs, for example:

 ERROR: dependency 'Rcpp' is not available for package 'RcppArmadillo' * removing '/root/R/x86_64-pc-linux-gnu-library/2.14/RcppArmadillo' ERROR: dependencies 'Rcpp', 'RcppArmadillo' are not available for package 'forecast' * removing '/root/R/x86_64-pc-linux-gnu-library/2.14/forecast' The downloaded packages are in '/tmp/RtmpJqQfrh/downloaded_packages' 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 
+4
source share
3 answers

I solved my problem as: First of all, I will add my CRAN to /etc/apt/sources.list. After that, I ran the following command from my terminal

 sudo apt-get update 

and then

 sudo apt-get upgrade 

After a successful upgrade, you will receive a command in console R

 install.packages("forecast") 

This solved my problem. For more information about this, you can visit cran.r-project.org/bin/linux/ubuntu.

And I thank Dirk Eddelbuettel for his kind suggestions.

+2
source

Your version of R is too outdated for current package versions, from forecast .

You can manually install an older version of the forecast package by downloading it from the CRAN Archive / Section . A good bet will have a version about the same age as your R.

If you upgrade R to the current version, Rcpp, RcppArmadillo, ... everything is installed normally, and there will also be the newest version of the forecast. Since you are on Ubuntu, it is actually very easy to get this new version, just read the README here and add the apt repository information as described.

+4
source

If the CRAN update does not work, gcc-fortran may be missing. This is necessary for quadprog, which is necessary for the dates, which, in turn, are necessary for the CRAN forecast package.

To install the gcc-fortran package on Arch Linux, run:

 # pacman -S gcc-fortran 

To install the fortran compiler on Ubuntu, run:

 # apt-get install gfortran 
0
source

All Articles