Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Forecast" library can't be installed

Tags:

r

I'm a newbie in R and as I'm following a script from another one, I'm in trouble for the fact I can't install (and recall) the "forecast" library. I've already read other posts but it seems no solutions have been successfully so far.

Some info:

  1. I installed R from "Cran -R-project"
  2. I simply tried to install the packages "forecast" from usual server (Italy) and after my installation I finally got this message:

    package ‘forecast’ successfully unpacked and MD5 sums checked

    The downloaded binary packages are in C:\Users\"myname"\AppData\Local\Temp\RtmpYjiY2w\downloaded_packages

  3. However, when I insert: library(forecast) it returns me this:

    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
      there is no package called ‘scales’
    Errore: package or namespace load failed for ‘forecast’
    
  4. My version is the 3.3.2 I don't know what to do, really I'm a dumb with this software, it's just three days I'm using.

Hope you can help me.

like image 689
Elghark Avatar asked Jan 30 '17 16:01

Elghark


People also ask

How do I install a forecast package?

To install a custom package, click R Package menu on project list page. Then click Install tab, type in package name “forecast”, and click Install button.

What is the forecast package in R?

The R package forecast provides methods and tools for displaying and analysing univariate time series forecasts including exponential smoothing via state space models and automatic ARIMA modelling.


3 Answers

Normally the problem is because of the curl. Try to install or update your current version of Curl. In linux Ubuntu use this:

sudo apt-get install libcurl4-openssl-dev libxml2-dev
like image 178
Amirkhm Avatar answered Oct 17 '22 14:10

Amirkhm


I recommend using install.packages("package_name") to install additional R packages. install.packages() takes care of dependencies to other packages (like scales in your case) and avoids such problems.

install.packages("forecast")

library(forecast)
like image 32
ottlngr Avatar answered Oct 17 '22 16:10

ottlngr


To install package on Ubuntu follow this steps: update openssl (curl update) and libxml (Development files for the GNOME XML library),

sudo apt-get install libcurl4-openssl-dev libxml2-dev

then install packages with its dependencies:

install.packages('forecast', dependencies = TRUE)

this worked for me on ubuntu 16.04

like image 29
Roshan Bagdiya Avatar answered Oct 17 '22 15:10

Roshan Bagdiya