Learn R Programming

tables (version 0.7.79)

latex.tabular: Display a tabular object using LaTeX.

Description

This is similar to print.tabular, but it inserts the code to display the table in a LaTeX tabular environment.

Usage

"latex"(object, file="", options=NULL, ...)

Arguments

object
The tabular object.
file
A filename to which to write the LaTeX code.
options
A list of options to set for the duration of the call.
...
Settings for default formatting. See Details below.

Value

The latex() method returns x invisibly, and prints the LaTeX script to the console.table_options() and booktabs() return the previous settings.

Details

The latex() method produces LaTeX output suitable for inclusion in a Sweave document.

See Also

print.tabular, table_options, latex

Examples

Run this code
tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
         (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
latex(tab)
save <- booktabs()
latex(tab)
table_options(save)

Run the code above in your browser using DataLab