capture.output {base} | R Documentation |
Evaluates its arguments with the output being returned as a character
string or sent to a file. Related to sink
in the same
way that with
is related to attach
.
capture.output(..., file = NULL, append = FALSE)
... |
Expressions to be evaluated |
file |
A file name or file connection, or |
append |
Append or overwrite the file? |
A character string, or NULL
if a file
argument was supplied.
sink
, textConnection
glmout<-capture.output(example(glm))
glmout[1:5]
capture.output(1+1,2+2)
capture.output({1+1;2+2})