eval_: [!] Parse and evaluate expression in a string

Description Usage Arguments Value See Also Examples

View source: R/eval_.R

Description

A wrapper function to parse a string and evaluate it as an expression. eval_(X) is a wrapper for eval(parse(text = X)).

Usage

1
eval_(X, envir = parent.frame(), ...)

Arguments

X

A string to be evaluated as an expression.

envir

the environment in which expr is to be evaluated. May also be NULL, a list, a data frame, a pairlist or an integer as specified to sys.call.

...

Further parameters to be passed to eval.

Value

Evaluated expression

See Also

Evaluate an (unevaluated) expression (eval), Parse expressions (parse)

Examples

1
2
3
4
5
6
7
if (any(ls() == "A")) rm(A)
any(ls() == "A")
#> [1] FALSE

eval_("A <- 3")
any(ls() == "A")
#> TRUE

GegznaV/spMisc documentation built on April 26, 2020, 5:59 p.m.