install quantstrat for R latest R version ()
Asked Answered
D

2

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)
Desiderata answered 3/7, 2017 at 17:47 Comment(0)
D
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")
Darnall answered 19/7, 2017 at 15:27 Comment(1)
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: r-forge.r-project.org/scm/viewvc.php/pkg/quantstrat/R/… 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: github.com/braverock/quantstrat'Alexandrite
M
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

Meteoric answered 3/7, 2017 at 18:43 Comment(5)
Great, that worked perfectly. Very clear answer, thanksDesiderata
tar.gz previous versions of quantstrat and blotter are not available at R-Forge for some reason -- does anyone have a solution for Linux?Hola
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.Meteoric
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. github.com/braverock/quantstratMeteoric
note that the R-Forge version explicitly states that the repository has moved to github: r-forge.r-project.org/scm/viewvc.php/pkg/quantstrat/R/… 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: github.com/braverock/quantstrat'Alexandrite

© 2022 - 2024 — McMap. All rights reserved.