exportTable: Export a LaTeX table to file

Description Usage Arguments Value Author(s) See Also

View source: R/summaryTable.R

Description

Exports a LaTeX table (as produced by xtable) to a file, optionally converting blanks to dashes and sanitizing text.

Usage

1
2
3
4
exportTable(data, filename = NULL, align = "l",
    include.rownames = FALSE, include.colnames = FALSE,
    sanitize.text.function = "default",
    blank = "$-$", digits = 3, booktabs = FALSE, ...)

Arguments

data

a data.frame or character matrix

filename

filename to export to. If NULL, the output is returned visibly by the function.

align

character vector indicating column alignment. If include.rownames is TRUE, it should have length equal to the number of columns + 1, otherwise it can have length equal to the number of columns. If it is shorter than this, the last element is repeated to make it the correct length. Unlike with the function xtable, align is not permitted to be a single character string.

include.rownames

whether row names should be included

include.colnames

whether column names should be included

sanitize.text.function

either 'default' or a function to convert special characters to LaTeX, for use by xtable in the output. The default is to handle <, _, >,

blank

text to enter in blank cells

digits

number of significant digits

booktabs

whether to use toprule, midrule etc. in place of {hline. There must be a \usepackage{booktabs} command in the preamble of the LaTeX document.

...

other arguments to pass to xtable.

Value

Returns a character vector with the LaTeX output. This is returned invisibly if filename is not NULL, otherwise it is returned invisibly.

Author(s)

Anoop Shah

See Also

summaryTable


CALIBERdatamanage documentation built on Nov. 23, 2021, 3 p.m.