I tried the following code for installation
>install.packages("forecast")
The error occurs like:
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
Your R version is too old for the current versions of the packages which forecast depends upon.
You can try manually installing an older version of the forecast package by downloading from its Archive/ section on CRAN. A good bet would a version of about the same age as your R installation.
If you upgrade R to a current version, the Rcpp, RcppArmadillo, ... all install fine, and so will the newest version of forecast. As you are on Ubuntu, it is actually extremely easy to get these newer version, just read the README here and add the apt repository information as described.
I resolved my problem as: First of all I have add the my CRAN to the /etc/apt/sources.list. After that I executed the following command from my terminal
sudo apt-get update
and then
sudo apt-get upgrade
Once the upgradation done successful the in R console give the command
install.packages("forecast")
This has resolved my problem. For details information regarding this you can visit cran.r-project.org/bin/linux/ubuntu.
And I thanks to Dirk Eddelbuettel for his kind suggestions.
If updating CRAN doesn't work, you might be missing gcc-fortran. This is needed for quadprog, which is needed for timeseries which in turn is needed for the CRAN forecast package.
To install the gcc-fortran package on Arch Linux, execute:
# pacman -S gcc-fortran
To install the fortran compiler on Ubuntu, execute:
# apt-get install gfortran
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With