rr-packagequadprog

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


i am trying to install the package "bfast" in R studio running R 3.5.3 and it throws up dependency error Warning in install.packages : dependency ‘quadprog’ is not available

i tried installing it using install.packages("bfast") and when i received the dependency error, i tried to install quadprog dependency as a package seperately like install.packages("quadprog") but then it showed me this error,Warning in install.packages : package ‘quadprog’ is not available (for R version 3.5.3)

here is the console status while installing bfast package.

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’

How can i properly install the package with all it's dependencies?


Solution

  • I just had the same problem. I looked where R was looking from (https://cran.rstudio.com/bin/windows/contrib/3.5/) and downloaded the 'quadprog' zip file from there. Then, in R or Rstudio, you go to install packages from "package archive file". It worked for me, I hope it does for you.