tbl2tex function

LaTeX table exporter

LaTeX table exporter

Export a data frame to a fancy LaTeX table environment.

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 = " ")

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

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.

Returns

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

Author(s)

Washington Leite Junger wjunger@ims.uerj.br

Note

For now, it handles only numerical data.

See Also

pgam

Examples

library(pgam) data(aihrio) m <- aihrio[1:10,4:10] tbl2tex(m,label="tbl:r_example",caption="R example of tbl2tex",digits=4)
  • Maintainer: Washington Junger
  • License: GPL-3 | file LICENSE
  • Last published: 2022-08-19

Useful links