R/r.reader.R

Defines functions r.reader

Documented in r.reader

#' Read an R source file with a .R file extension.
#'
#' This function will call source on the specified R file, executing the
#' code inside of it as a way of generating data sets dynamically, as in
#' many Monte Carlo applications.
#'
#' @param data.file The name of the data file to be read.
#' @param filename The path to the data set to be loaded.
#' @param variable.name The name to be assigned to in the global environment.
#'
#' @return No value is returned; this function is called for its side effects.
#'
#' @examples
#' library('ProjectTemplate2')
#'
#' \dontrun{r.reader('example.R', 'data/example.R', 'example')}
r.reader <- function(data.file, filename, variable.name)
{
  source(filename)
}
connectedblue/ProjectTemplate2 documentation built on May 17, 2019, 2:46 p.m.