R/tutorials.R

Defines functions tutorials

Documented in tutorials

#' @title Return a data.frame with all currently available tutorials code cases
#'
#' @description
#' \code{tutorials} returns a data.frame with all currently available
#' tutorial code cases based on the tutorial.csv in the /inst 
#' directory.
#'
#' @author Ronald Hochreiter, \email{ronald@@algorithmic.finance}
#'
#' @export
tutorials <- function() {
  df.tutorials <- read.csv(paste0(path.package("quantR"), "/tutorials.csv"), sep=";", header=FALSE)
  names(df.tutorials) <- c("id", "order", "short", "updated", "version", "title", "description", "status")
  sorted.order <- sort(df.tutorials$order, index.return = TRUE)$ix
  active.tutorials <- which(df.tutorials$status == 1)
  tutorial.list <- intersect(sorted.order, active.tutorials)
  return(df.tutorials[tutorial.list,c(3,6,4,5)])
}
smartbeta/quant-r documentation built on May 28, 2019, 7:37 a.m.