Convert a Data Frame or Matrix to a LaTeX Tabular
latexTabular.RdlatexTabular creates a character vector representing a matrix or
data frame in a simple tabular environment.
Arguments
- x
a matrix or data frame, or a vector that is automatically converted to a matrix
- headings
a vector of character strings specifying column headings for latexTabular, defaulting to
x'scolnames. To make multi-line headers use the newline character inside elements ofheadings.- align
a character strings specifying column alignments for latexTabular, defaulting to
paste(rep('c',ncol(x)),collapse='')to center. You may specifyalign='c|c'and other LaTeX tabular formatting.- halign
a character strings specifying alignment for column headings, defaulting to centered.
- helvetica
set to
FALSEto use default LaTeX font in latexTabular instead of helvetica.- translate
set to
FALSEif column headings and table entries are already in LaTeX format, otherwiselatexTabularwill run them throughlatexTranslate- hline
set to 1 to put
hlineafter heading, 2 to also puthlines before and after heading and at table end- center
set to
TRUEto enclose the tabular in a LaTeXcenterenvironment- ...
if present,
xis run throughformat.dfwith those extra arguments
Author
Frank E. Harrell, Jr.,
Department of Biostatistics,
Vanderbilt University,
fh@fharrell.com