R/setup.R

Defines functions setup

Documented in setup

#' @title Install required non-CRAN packages from GitHub and elsewhere for the tutorials
#'
#' @description
#' \code{setup} installs all required non-CRAN packages from 
#' GitHub and elsewhere
#'
#' @author Ronald Hochreiter, \email{ronald@@algorithmic.finance}
#'
#' @export
setup <- function() {
  # Install Packages from CRAN
  packages <- c("devtools", "quantmod", "tseries", "dplyr", "CVXR", "ROI", "ROI.plugin.glpk", "ompr", "ompr.roi")

  for(package in packages) {
    if(!(package %in% rownames(installed.packages()))) { install.packages(package) }
  }

  # Install Packages from GitHub
  library("devtools")
  if(!("modopt.matlab" %in% rownames(installed.packages()))) { install_github("rhochreiter/modopt.matlab") }
  if(!("scenportopt" %in% rownames(installed.packages()))) { install_github("rhochreiter/scenportopt") }
  
  # Get the latest tutorials.csv
  quantR::update()

  # Return TRUE whatever happens...
  return(TRUE)  
}
smartbeta/quant-r documentation built on May 28, 2019, 7:37 a.m.