Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

install quantstrat for R latest R version ()

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)
like image 713
jonas Avatar asked Jul 03 '17 17:07

jonas


Video Answer


2 Answers

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")
like image 86
gaga5lala Avatar answered Oct 06 '22 21:10

gaga5lala


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

  • http://download.r-forge.r-project.org/bin/windows/contrib/3.2/quantstrat_0.9.1739.zip and
  • http://download.r-forge.r-project.org/bin/windows/contrib/3.2/blotter_0.9.1741.zip

(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

like image 41
wibeasley Avatar answered Oct 06 '22 23:10

wibeasley