[ top | up ]

Evaluate an (Unevaluated) Expression

Syntax

eval(expr, envir=NULL, quote=FALSE)

Description

eval evaluates the expression expr argument in the environment specified by envir. If envir is NULL then the environment where the call to eval is made is used.

If quote is true then the expression is {\em quoted} before being evaluated. This is equivalent to wrapping a call to substitute around expr before passing it to the internal evaluator.

See Also

expression, environment.

Examples

eval(2 ^ 2 ^ 3) mEx <- expression(2^2^3); mEx; 1 + eval(mEx) eval({ xx <- pi; xx^2}) ; xx