Got the following error while trying to load up the library forecast


#1

library(forecast)
Error: package or namespace load failed for ‘forecast’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘lmtest’

install.packages("lmtest")
... cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/lmtest_0.9-35.tgz'
Warning in install.packages :
download of package ‘lmtest’ failed


#2

Did you try installing lmtest?


#3

I did. But there is an error in downloading it.


#4

Sorry; I missed that in your original post.

I was able to download lmtest just now:

> install.packages("lmtest")
Installing package into '/Users/kevin/Library/R/3.4/library'
(as 'lib' is unspecified)
trying URL 'https://cran.rstudio.org/bin/macosx/el-capitan/contrib/3.4/lmtest_0.9-36.tgz'
Content type 'application/x-gzip' length 277347 bytes (270 KB)
==================================================
downloaded 270 KB

And the CRAN webpage suggests that package was just updated:

https://cran.r-project.org/web/packages/lmtest/index.html

So you might need to restart R and just try installation again once more.