When I attempt to install a package - forecast, I get the following error

utils:::menuInstallPkgs() 
trying URL http://cran.revolutionanalytics.com/bin/windows/contrib/3.0/forecast_5.4.zip
Content type 'application/zip' length 1194249 bytes (1.1 Mb) 
opened URL 
downloaded 1.1 Mb

package ‘forecast’ successfully unpacked and MD5 sums checked 
Warning: cannot remove prior installation of package ‘forecast’

library(forecast) 
Error in library(forecast) : there is no package called ‘forecast’

There are instances of this happening to not only the forecast package.  It appears to happen when the previous version does not get removed because to file is in use or the archive is corrupt.  The correction is not difficult.

In RRE, type 

.libPaths() and press enter

This should give you the directory(ies) the libraries are stored. Navigate to the location and delete the forecast folder and it's contents.

You will need to close RRE before you can delete the folder.

Then restart RRE, and type 
install.packages('forecast') and press enter

Once complete, type 
library(forecast)

This will re install the latest version of the package or clean up the archive if corrupt.

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

What affected your experience?

Thank you for your feedback!

×