7

I would like to install a package when using the latest R version in RStudio. In particular the quantstrat package Is that possible?

This is the R latest version I have 3.4.1

my error message:

Warning in install.packages :
  package ‘quantstrat’ is not available (for R version 3.4.1)
jonas
  • 13,559
  • 22
  • 57
  • 75

2 Answers2

26

Because quantstrat build-fail at R-Forge, you can't get the pre-build file(.tar.gz). You can get the code from github and build by yourself.

install.packages("devtools")
require(devtools)
install_github("braverock/blotter") # dependency
install_github("braverock/quantstrat")
gaga5lala
  • 1,218
  • 13
  • 17
  • 3
    This answer is correct. quantstrat should be installed from github. Note that the R-Forge version explicitly states that the repository has moved to github: https://r-forge.r-project.org/scm/viewvc.php/pkg/quantstrat/R/zzz.R?view=markup&revision=1749&root=blotter says "WARNING: this package was installed from R-Forge, but development has moved to GitHub. Please re-install the package using the GitHub repo at: https://github.com/braverock/quantstrat' – Brian G. Peterson Aug 05 '17 at 09:37
7

Can you provide the installation code that produced that error message? Are you trying to install it from CRAN?

That doesn't appear possible.

  1. A post from 2014 states it's not on CRAN

    quantstrat is a R package ... still under heavy development and can’t be installed from CRAN yet. You can install it from source and the process is straightforward.

  2. It's not on the current list of available CRAN packages

It's R-Forge page states the current version 'Failed to build'.

You could download the previous version (and its dependency) from R-Forge at

(or get the Linux tar.gz files). Assuming they're saved in your personal Downloads folder, install it in R with

install.packages("~/Downloads/blotter_0.9.1741.zip", repos = NULL)
install.packages("~/Downloads/quantstrat_0.9.1739.zip", repos = NULL)

According to that first link, you'll need to install these prereqs first, if they're not already:

install.packages("FinancialInstrument")
install.packages("PerformanceAnalytics")
install.packages("foreach")

Edit: see the comment below from @brian-g-peterson for how the current deployment avenue uses GitHub. https://github.com/braverock/quantstrat

wibeasley
  • 5,000
  • 3
  • 34
  • 62
  • Great, that worked perfectly. Very clear answer, thanks – jonas Jul 03 '17 at 20:01
  • tar.gz previous versions of quantstrat and blotter are not available at R-Forge for some reason -- does anyone have a solution for Linux? – jogall Jul 11 '17 at 07:17
  • I see the links to the linux tar aren't connected. I guess you should be able to use SVN to download the source files and roll back the clock to a point where the build was successful. – wibeasley Jul 11 '17 at 15:39
  • This GitHub repo apparently is hosted by one of the same guys. I don't why GitHub & R-Forge sites aren't connected explicitly. Check it carefully, and make sure you're comfortable with the risk. you probably want to start a new issue (related to linux & quanstrat) to have a few more people provide their opinions. https://github.com/braverock/quantstrat – wibeasley Jul 11 '17 at 15:43
  • note that the R-Forge version explicitly states that the repository has moved to github: https://r-forge.r-project.org/scm/viewvc.php/pkg/quantstrat/R/zzz.R?view=markup&revision=1749&root=blotter says "WARNING: this package was installed from R-Forge, but development has moved to GitHub. Please re-install the package using the GitHub repo at: https://github.com/braverock/quantstrat' – Brian G. Peterson Aug 05 '17 at 09:35