XSLParseEval: Evaluate an S expression from an XSL string

Description Usage Arguments Value Author(s) References See Also Examples

Description

Thes functions ares used to evaluate an R command given as a string. XSLParseEval is used as the implementation of the XSL function r:eval(). It parses the string, evaluates the resulting expression and converts the result back to XSL, if desired.

XSLNULLParseEval discards the return value from evaluating the command. This avoids converting it to an XSL object.

XSLParseEvalWithOutput uses capture.output to return the output from evaluating the command. It ignores the return value and returns a single string containing the output.

Usage

1
2
3

Arguments

cmd

the string giving the S command or expression.

className

the class to assign to the result of the expression, if it has none. This is used in conjunction with

asXML

a logical value indicating whether to attempt to explicitly convert the result of evaluating the expression to XML using the toXML function and associated methods. This, along with className, can be used to control and customize how non-primitive objects are returned to the XSLT engine.

name

if specified, the result of the expression is assigned to the R session's global environment using this value as its name. This allows the result to be used in subsequent computations.

env

the environment in which the evaluation of the parsed expression is performed.

Value

The value of parsing and evaluating the S expression given by cmd, optionally converted to an S object giving the XML representation if asXML is TRUE.

Author(s)

Duncan Temple Lang

References

http://www.omegahat.org/Sxslt, http://www.omegahat.org/SXalan, http://www.w3.org/Style/XSL

See Also

eval, parse, the XML package for creating C-level XML nodes.

Examples

1
2
3
 XSLParseEval("rnorm(10)")
 XSLParseEval("rnorm(10)", className = "Array")
 XSLParseEval("rnorm(10)", className = "Array", name="me")

sckott/sxslt documentation built on May 26, 2017, 3:49 a.m.