R/sourceAll.R

Defines functions sourceAll

Documented in sourceAll

#' Run All TAF Scripts
#'
#' Run core TAF scripts in current directory.
#'
#' @param \dots passed to \code{\link{sourceTAF}}.
#'
#' @return Logical vector, indicating which scripts ran without errors.
#'
#' @note
#' TAF scripts that will be run if they exist: \verb{utilities.R},
#' \verb{data.R}, \verb{model.R}, \verb{output.R}, and \verb{report.R}.
#'
#' @seealso
#' \code{\link{sourceTAF}} runs a TAF script.
#'
#' \code{\link{makeAll}} runs all TAF scripts as needed.
#'
#' \code{\link{clean}} cleans TAF directories.
#'
#' \code{\link{TAF-package}} gives an overview of the package.
#'
#' @examples
#' \dontrun{
#' sourceAll()
#' }
#'
#' @export

sourceAll <- function(...)
{
  scripts <- c("utilities.R", "data.R", "model.R", "output.R", "report.R")
  scripts <- scripts[file.exists(scripts)]

  out <- sapply(scripts, sourceTAF, ...)
  if(length(out) == 0)
    out <- logical(0)

  invisible(out)
}

Try the TAF package in your browser

Any scripts or data that you put into this service are public.

TAF documentation built on April 7, 2021, 5:06 p.m.