R/update.R

Defines functions update

Documented in update

#' @title Update tutorials.csv in the package path
#'
#' @description
#' \code{update} updates the current list of tutorials without requiring
#' to update the package.
#'
#' @author Ronald Hochreiter, \email{ronald@@algorithmic.finance}
#'
#' @export
update <- function() {
  status <- FALSE

  url <- paste0("https://s3.amazonaws.com/learn-r.net/quant-r/tutorials.csv")
  destfile <- paste0(tempdir(), "/tutorials.csv")
  filename <- paste0(path.package("quantR"), "/tutorials.csv")

  download.file(url, destfile, quiet=TRUE)
  
  status <- file.copy(destfile, filename, overwrite=TRUE)

  return(status)
}
smartbeta/quant-r documentation built on May 28, 2019, 7:37 a.m.