toText: Convert Objects to (Plain) Text

View source: R/functions.R

toTextR Documentation

Convert Objects to (Plain) Text

Description

Converts an R object into a text representation.

Usage

toText(x, ...)

## Default S3 method:
toText(x, ...)

Arguments

x

an object

...

arguments passed to methods

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.

Value

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

Author(s)

Enrico Schumann

See Also

toLatex, toHTML

Examples

toText(c("a", "b", "c"))
cat(toHTML(toText(c("a", "b", "c"))))


textutils documentation built on April 3, 2023, 5:34 p.m.