R/srcenv.R

Defines functions srcenv

Documented in srcenv

#' Return an environment with objects defined in a script file
#'
#' @param file R file to source
#' @param ... other arguments passed to \code{sys.source}
#' 
#' @export 
srcenv <- function(file, ...) {
  e <- new.env(parent.frame())
  sys.source(file, envir=e, ...)
  e
}
mbojan/mbtools documentation built on Nov. 9, 2017, 3:21 p.m.