Learn R Programming

textutils (version 0.4-1)

toText: Convert Objects to (Plain) Text

Description

Converts an R object into a text representation.

Usage

toText(x, ...)

# S3 method for default toText(x, ...)

Value

A character vector (lines of text), possibly with a class attribute

text.

Arguments

x

an object

...

arguments passed to methods

Author

Enrico Schumann

Details

A generic function. Method are expected to coerce a given object to lines of human-readable text that can be used, for instance, for reports. The purpose of toText is not to store data in a form that can be read and understood by R; for that, see dput or dump.

The print method is essentially equivalent to cat(x, sep = "\n") .

There is no restriction on encoding, so plain text does not necessarily mean ASCII. But current methods do not map into markup-representations.

See Also

toLatex, toHTML

Examples

Run this code
toText(c("a", "b", "c"))
cat(toHTML(toText(c("a", "b", "c"))))

Run the code above in your browser using DataLab