包或命名空间加载失败

问题描述 投票:0回答:1

我不知道发生了什么,但每当我打电话给预测包时,这个NAMESPACE LOAD FAILURE就会到来。

所以我使用了这行代码

install.packages("forecast",repos = c("http://rstudio.org/_packages",
                            "http://cran.rstudio.com"))

这是我在运行此代码后得到的控制台消息

Installing package into ‘C:/Users/adarsh/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
  unable to access index for repository 
http://rstudio.org/_packages/bin/windows/contrib/3.5:
  cannot open URL 
'http://rstudio.org/_packages/bin/windows/contrib/3.5/PACKAGES'

  There is a binary version available but the
  source version is later:
         binary source needs_compilation
forecast    8.6    8.7              TRUE

  Binaries will be installed
trying URL 
'http://cran.rstudio.com/bin/windows/contrib/3.5/forecast_8.6.zip' 
Content type 'application/zip' length 2345112 bytes (2.2 MB)
downloaded 2.2 MB

package ‘forecast’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\adarsh\AppData\Local\Temp\RtmpQ58pju\downloaded_packages

我检查了其他包装是否也是如此。

install.packages("tseries")


Installing package into ‘C:/Users/adarsh/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
  dependency ‘quadprog’ is not available
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/tseries_0.10-46.zip'
Content type 'application/zip' length 414767 bytes (405 KB)
downloaded 405 KB
package ‘tseries’ successfully unpacked and MD5 sums checked**

**The downloaded binary packages are in
    C:\Users\adarsh\AppData\Local\Temp\RtmpQ1vu1H\downloaded_packages**


    library(tseries)


Error: package or namespace load failed for ‘tseries’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘quadprog’
In addition: Warning message:
package ‘tseries’ was built under R version 3.5.3  

同样的错误再次发生。请有人帮帮我。

r forecasting
1个回答
0
投票

我从cran存储库下载了“quadprog”软件包,并将其保存为C://Users/yourname/Documents/package_file.zip中的zip文件。

然后在R studio中使用选项包存档文件(.zip; .tar.gz)并安装上述包。

谢谢

© www.soinside.com 2019 - 2024. All rights reserved.