Expression Objects

DESCRIPTION:

Creates or tests for objects of mode expression.

USAGE:

expression(...) 
as.expression(x) 
is.expression(x) 

OPTIONAL ARGUMENTS:

...
any valid S-PLUS expressions. They will notbe evaluated by the call to expression.

x
a S-PLUS object.

VALUE:

expression returns an expression, that is, a list-like object of mode "expression". Its elements are the arguments, unsubstituted and unevaluated.

as.expression merely changes the mode of x to "expression".

is.expression returns TRUE if x has mode "expression" and FALSE otherwise.

DETAILS:

Both is.expression and as.expression are generic functions; currently there are no methods defined for either of these.

BACKGROUND:

The output from parse is of mode "expression".

SEE ALSO:

, , .

EXAMPLES:

methods <- expression(lsfit(x,y), l1fit(x,y)) 
eval(methods[[which]]) 

rand.choice <- expression("Gaussian"=rnorm(1),"exp"=rexp(1),"uniform"=runif(1)) 
eval(rand.choice[["exp"]])