run: Build and evaluate code

View source: R/run.R

runR Documentation

Build and evaluate code

Description

run(...) Collapses ... into a character scalar and evaluates it as code in the environment of the calling function.

Usage

run(...)

Arguments

...

Arguments to be pasted into a character scalar command to be run (i.e., parsed and evaluated) in the environment where run(...) was called.

Value

The value returned upon evaluating the character scalar created from collapsing ... arguments.

See Also

Other meta: callers(), console_help(), dot_args(), pause(), ply_help(), purge_help(), recycling_help()

Examples

egCallVec <- paste0("'", 0:3, "'")
egCallVec <- c("paste0(", egCallVec, ", collapse = '')")
egCallVec <- c("egResultVec <- ", egCallVec)
run(egCallVec)

egCallScl <- paste0(egCallVec, collapse = "")
egCallScl <- paste0("egResultScl <- ", egCallScl)
run(egCallScl)

print(egCallVec)
print(egCallScl)
print(egResultVec)
print(egResultScl)

egRUNalias1 <- function(x, y) {egDTFalias(var.x = x, var.y = y)}
egRUNalias2 <- function(x, y) {egRUNalias1(x, y)}


j-martineau/uj documentation built on Sept. 14, 2024, 4:40 a.m.