1

我正在尝试在运行 R 3.5.3 的 R Studio 中安装包“bfast”,它会引发依赖错误Warning in install.packages : dependency ‘quadprog’ is not available

我尝试使用安装它install.packages("bfast"),当我收到依赖项错误时,我尝试将 quadprog 依赖项作为一个包单独安装,install.packages("quadprog")但随后它向我显示了此错误,Warning in install.packages : package ‘quadprog’ is not available (for R version 3.5.3)

bfast这是安装软件包时的控制台状态。

install.packages("bfast")
Installing package into ‘/home/rehan/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
  dependency ‘quadprog’ is not available
also installing the dependencies ‘tseries’, ‘forecast’

trying URL 'https://cloud.r-project.org/src/contrib/tseries_0.10-46.tar.gz'
Content type 'application/x-gzip' length 164471 bytes (160 KB)
==================================================
downloaded 160 KB

trying URL 'https://cloud.r-project.org/src/contrib/forecast_8.6.tar.gz'
Content type 'application/x-gzip' length 908972 bytes (887 KB)
==================================================
downloaded 887 KB

trying URL 'https://cloud.r-project.org/src/contrib/bfast_1.5.7.tar.gz'
Content type 'application/x-gzip' length 59697 bytes (58 KB)
==================================================
downloaded 58 KB

ERROR: dependency ‘quadprog’ is not available for package ‘tseries’
* removing ‘/home/rehan/R/x86_64-pc-linux-gnu-library/3.5/tseries’
Warning in install.packages :
  installation of package ‘tseries’ had non-zero exit status
ERROR: dependency ‘tseries’ is not available for package ‘forecast’
* removing ‘/home/rehan/R/x86_64-pc-linux-gnu-library/3.5/forecast’
Warning in install.packages :
  installation of package ‘forecast’ had non-zero exit status
ERROR: dependency ‘forecast’ is not available for package ‘bfast’
* removing ‘/home/rehan/R/x86_64-pc-linux-gnu-library/3.5/bfast’
Warning in install.packages :
  installation of package ‘bfast’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpSfjWA6/downloaded_packages’

如何正确安装包含所有依赖项的软件包?

4

2 回答 2

1

我只是有同样的问题。我查看了 R 从哪里查看(https://cran.rstudio.com/bin/windows/contrib/3.5/)并从那里下载了“quadprog”zip 文件。然后,在 R 或 Rstudio 中,您可以从“包存档文件”安装包。它对我有用,我希望它对你有用。

于 2019-04-26T21:53:35.337 回答
0

有一个新版本的 Quadprog:1.5-7 可以安装在 3.1 以上的 R 上:https ://cran.r-project.org/web/packages/quadprog/index.html 这为我解决了。

于 2019-05-07T16:17:19.267 回答