run: Evaluate character strings as an expression

Description Usage Arguments Value Examples

Description

Evaluate character strings as an expression in the appropriate frame so the function can be used in a function and use variables in the environment of the function.

Usage

1
2
run(..., envir = parent.frame(), enclos = if (is.list(envir) ||
  is.pairlist(envir)) parent.frame() else baseenv(), try = TRUE)

Arguments

...

expressions that can evaluate to character strings to paste.

envir

(default = parent.frame()) see eval.

enclos

(default same as eval)

try

(default: TRUE) enclose the expression in try.

Value

the result of evaluating paste0(...) as an expression

Examples

1
2
run('ls()')
for(nam in c('ls','search')) print(run(nam,"()"))  # very unimaginative example

gmonette/yscs documentation built on May 17, 2019, 7:28 a.m.