multiREvaluator
Evaluates an Expression in One or More R-language Interpreters
Description
Evaluate an R-language expression in one or more R-language interpreters
and possibly compares the results.
Usage
RCompare(expr, REvaluators = DefaultREvaluators(), substitute = TRUE,
data = NULL, envirData = parent.frame(), tolerance = 0,
returnValues = TRUE, verbose = FALSE)
multiREvaluator(expr, REvaluators = DefaultREvaluators(), substitute = TRUE,
data = NULL, envirData = parent.frame(), verbose = FALSE,
sideBySide = TRUE, PRINTFUN = "print")
DefaultREvaluators()
Arguments
expr |
an expression to be evaluated.
|
REvaluators |
a list of REvaluator objects,
as created by the makeREvaluator function.
The defaults evaluate the expressions in open-source R
and TIBCO Enterprise Runtime for R.
|
substitute |
a logical value. Specifies how to use the expr argument.
|
data |
if not NULL, then either a character vector or a named list specifying
the objects that must be put into the environment where expr is
evaluated. See TERREvaluator for details.
|
envirData |
the environment where items in the character vector data are found.
|
verbose |
a logical value. If TRUE, debugging information is printed. The default is FALSE.
|
tolerance |
a small positive numeric value that is passed to all.equal to specify
how far apart two numeric results must be before a difference is reported.
|
returnValues |
a logical value.
- If TRUE (the default), then RCompare returns a list
containing the results of all the evaluations, along with a list describing how each
result (except the first) differs from the first.
- If FALSE, it returns only the description of the differences.
|
sideBySide |
a logical value. If TRUE (the default), then give the output of multiEvaluator
the class "sideBySide" so the output components are printed next
to each other, if possible.
|
PRINTFUN |
a function or the name of a function. This is passed to sideBySide to
specify how to print the output components.
|
Value
multiREvaluator | returns a list of the results of evaluating the expression
in each R interpreter.
The names of the list are taken from version$version.string
in each interpreter.
The returned list has the class "sideBySide",
whose print method attempts to print the outputs beside each other
for easier visual comparison. |
RCompare | usually returns the same value as multiEvaluator,
with the addition of the attribute all.equal,
describing the differences between the results. |
RCompare(..., returnValues) | returns just the list of differences. |
DefaultREvaluators | returns getOption("REvaluators")
if it is a list of "REvaluator" objects.
Otherwise, it returns list(RinR::REvaluator, RinR::TERREvaluator),
two of the built-in REvaluators. |
See Also
Examples
## Not run:
pushPATH("C:/Program Files/R/R-2.15.3/bin")
RCompare(log2(xTest), data = list(xTest=4:16))
RCompare(lm(hp ~ gear + am, data=mtcars), REvaluators=list(REvaluator, LocalEvaluator), tol=1e-12)
myData <- subset(iris, Species == "setosa", -Species)
RCompare(prcomp(myData), data = "myData")
## End(Not run)