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. Note that the separator for pasting is ” to allow expressions within quotes.

envir

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

enclos

(default same as eval)

try

(default TRUE) enclose the expression in try.

Value

the result of evaluating paste(...,sep='') as an expression

Examples

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

gmonette/spidanew documentation built on May 17, 2019, 7:27 a.m.