captureAll {svMisc} | R Documentation |
This function captures results of evaluating an R expression the same way as
it would be done in a R console. The result is in a character string. Errors,
warnings and other consitions are treated as usual, including the delayed
display of the warnings if options(warn = 0)
.
captureAll(expr)
expr |
A valid R expression to evaluate |
Returns a string with the result of the evaluation done in the user workspace.
Philippe Grosjean (phgrosjean@sciviews.org)
writeLines(captureAll(1+1)) writeLines(captureAll(Parse("search()"))) ## Not run: writeLines(captureAll(Parse('1:2 + 1:3'))) writeLines(captureAll(Parse("badname"))) ## End(Not run)