powered by
This is similar to print.tabular, but it inserts the code to display the table in a LaTeX tabular environment.
print.tabular
# S3 method for tabular latex(object, file = "", options = NULL, append = FALSE, ...)
The tabular object.
A filename or connection to which to write the LaTeX code, or "" to write to the standard output.
""
A list of options to set for the duration of the call.
If TRUE, opens file for appending (if it is a filename rather than a connection).
TRUE
file
Settings for default formatting. See Details below.
The latex() method returns x invisibly, and prints the LaTeX script to the console.
latex()
x
table_options() and booktabs() return the previous settings.
table_options()
booktabs()
The latex() method produces LaTeX output suitable for inclusion in a Sweave document.
Sweave
print.tabular, table_options, latex
table_options
latex
# NOT RUN { 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