我试图在运行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’
我怎样才能正确安装包含所有依赖项的包?
我刚遇到同样的问题。我看着R从哪里看(https://cran.rstudio.com/bin/windows/contrib/3.5/)并从那里下载了'quadprog'zip文件。然后,在R或Rstudio中,您将从“包归档文件”安装包。它对我有用,我希望它对你有用。
有一个新版本的Quadprog:1.5-7可以安装在R 3.1以上:https://cran.r-project.org/web/packages/quadprog/index.html这为我解决了它。