依赖项 'quadprog' 不可用于安装包 'bfast'

dependency 'quadprog' is not available for installing package 'bfast'

我正在尝试在 R studio 运行 R 3.5.3 中安装包 "bfast",它抛出了依赖性错误 Warning in install.packages : dependency ‘quadprog’ is not available

我尝试使用 install.packages("bfast") 安装它,当我收到依赖项错误时,我尝试像 install.packages("quadprog") 一样将 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’

如何正确安装包及其所有依赖项?

我刚遇到同样的问题。我查看了 R 从 (https://cran.rstudio.com/bin/windows/contrib/3.5/) 查找的位置,并从那里下载了 'quadprog' zip 文件。然后,在 R 或 Rstudio 中,您可以从 "package archive file" 安装软件包。它对我有用,我希望它对你有用。

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