Learn R Programming

pgam (version 0.4.17)

tbl2tex: LaTeX table exporter

Description

Export a data frame to a fancy LaTeX table environment.

Usage

tbl2tex(tbl, label = "tbl:label(must_be_changed!)", 
caption = "Table generated with tbl2tex.", centered = TRUE, 
alignment = "center", digits = getOption("digits"), hline = TRUE, 
vline = TRUE, file = "", topleftcell = "   ")

Value

LaTeX code is routed through file or console for copying and pasting.

Arguments

tbl

object of type data frame or matrix

label

label for LaTeX cross reference

caption

caption for LaTeX tabular environment

centered

logical. TRUE for centered cells

alignment

alignment of the object on the page

digits

decimal digits after decimal point

hline

logical. TRUE for horizontal borders

vline

logical. TRUE for vertical borders

file

filename for outputting. If none is provided, LaTeX code is routed through the console

topleftcell

text for the top-left cell of the table

Author

Washington Leite Junger wjunger@ims.uerj.br

Details

This is a utility function intended to ease convertion of R objects to LaTeX format. It only exports data frame or data matrix nonetheless.

See Also

pgam

Examples

Run this code
library(pgam)
data(aihrio)
m <- aihrio[1:10,4:10]
tbl2tex(m,label="tbl:r_example",caption="R example of tbl2tex",digits=4)

Run the code above in your browser using DataLab