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)
}
yikeshu0611/do documentation built on Aug. 5, 2021, 4:17 p.m.