问题
I'm working on RStudio, and I have the forecast
package installed, if I look at the lateral bar, it's there.
However, when I run library("forecast")
, it gives me the following error:
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘ggplot2’
In addition: Warning message:
package ‘forecast’ was built under R version 3.3.3
Error: package or namespace load failed for ‘forecast’
There is indeed no package called ggplot2
but I've never had this issue before. When I try to install ggplot2
just in case I get the error:
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
Which is I guess a related issue.
I've trying the following as is suggested here, with no success:
remove.packages(c("forecast","ggplot2"))
install.packages('ggplot2')
install.packages('forecast')
What can I do?
Edit:
This is the output of sessionInfo()
:
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Catalan_Spain.1252 LC_CTYPE=Catalan_Spain.1252 LC_MONETARY=Catalan_Spain.1252
[4] LC_NUMERIC=C LC_TIME=Catalan_Spain.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] colorspace_1.3-2 parallel_3.3.2 tools_3.3.2 Rcpp_0.12.16 fracdiff_1.4-2
来源:https://stackoverflow.com/questions/54386372/r-package-or-namespace-load-failed-for-forecast