Learn R Programming

latexpdf (version 0.1.8)

reserve.data.frame: Escape LaTeX Reserved Characters in Data Frames

Description

Applies reserve to the columns of a data.frame.

Usage

# S3 method for data.frame
reserve(x, ...)

Arguments

x

object

...

passed arguments

See Also

Other reserve: reserve.character(), reserve.default(), reserve.factor(), reserve.list(), reserve()

Examples

Run this code
foo <- c('#','$%^','&_{','}~\\')
bar <- data.frame(
 stringsAsFactors = FALSE,
 a = as.numeric(factor(foo)),
 b = foo,
 c = factor(foo)
)

reserve(bar)
# as.pdf(bar, wider = 10)
# as.pdf(bar, target = '#') # fails

Run the code above in your browser using DataLab