This help topic is for R version 1.7.1. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/capture.output.html
capture.output {base}R Documentation

Send output to a character string or file

Description

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.

Usage

capture.output(..., file = NULL, append = FALSE)

Arguments

...

Expressions to be evaluated

file

A file name or file connection, or NULL to return the output as a string

append

Append or overwrite the file?

Value

A character string, or NULL if a file argument was supplied.

See Also

sink, textConnection

Examples

glmout<-capture.output(example(glm))
glmout[1:5]
capture.output(1+1,2+2)
capture.output({1+1;2+2})

[Package base version 1.7.1 ]