1

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?

M--
  • 25,431
  • 8
  • 61
  • 93
Rehan
  • 371
  • 1
  • 6
  • 29

2 Answers2

1

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.

  • thanks. that helped me in solving the problem. i forgot to mention that am working on linux so i had to go through the linxu contributions available on the same website as provided in the answer above and use an older version of zip file as the latest version is still not available for linux which worked perfect for me – Rehan Apr 27 '19 at 12:12
  • I had the same problem (under linux). Quadprog 1.5-6 works only with R version 3.6.0 and higher. Solved this issue by installing version 1.5-5 of quadprog from https://cran.r-project.org/src/contrib/Archive/quadprog/ – farnsy May 01 '19 at 01:33
0

There is a new version of Quadprog: 1.5-7 that can install on R above 3.1:https://cran.r-project.org/web/packages/quadprog/index.html That solved it for me.