R:“预测”的包或名称空间加载失败

时间:2019-01-27 08:31:55

标签: r install.packages

我正在使用RStudio,并且已经安装了forecast软件包,如果我看一下侧边栏,它就在那里。

enter image description here

但是,当我运行library("forecast")时,出现以下错误:

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’

确实没有称为ggplot2的软件包,但我以前从未遇到过此问题。当我尝试安装ggplot2时,以防万一出现错误:

Warning in install.packages :
  installation of package ‘ggplot2’ had non-zero exit status

我猜这是一个相关问题。

我正在尝试以下建议的here,但没有成功:

remove.packages(c("forecast","ggplot2"))
install.packages('ggplot2')
install.packages('forecast')

我该怎么办?

编辑:

这是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

0 个答案:

没有答案