R/exec.R

Defines functions exec

Documented in exec

#' execute string command
#' This command just execute in the paraent frame.
#' @param string one string
#' @param envir the environment in which sting is to be evaluated.
#' @return execute string command
#' @export
#'
#' @examples
#' a=2
#' exec('a = 1')
#' a
exec <- function(string,envir = parent.frame()){
    eval(expr = parse(text = string),envir = envir)
}

Try the do package in your browser

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

do documentation built on Aug. 3, 2021, 5:06 p.m.