Coerces to LaTeX table environment. Generic, with methods for data.frame, table, and matrix.
Coerces to LaTeX table from data.frame. See details.
Coerces to ltable from table, reclassifying its argument as matrix.
Coerces to ltable from matrix; tires to capture the column names as a caption, and (like as.tabular.matrix
) converts its argument to data.frame, capturing rownames as a column in the first position if rownames are suitably named.
as.ltable(x, ...)# S3 method for data.frame
as.ltable(
x,
caption = NULL,
cap = caption,
cap.top = TRUE,
label = NULL,
options = "H",
environments = "center",
source = NULL,
file = NULL,
source.label = "source: ",
file.label = "file: ",
basefile = FALSE,
footnote.size = "tiny",
...
)
# S3 method for table
as.ltable(x, ...)
# S3 method for matrix
as.ltable(x, caption = names(dimnames(x))[[2]], ...)
character
object
passed arguments
full version of the caption
short version of the caption, for list of tables
Should caption be placed at the top, instead of bottom?
optional label
options for latex table environment, e.g. H or !htpb
extra environments to nest between ‘table’ and ‘tabular’
optional source attribution
optional file name
optional text to preceed source if specified
optional text to preceed file if specified
if TRUE, strip path from file for display purposes
font size for source and file, etc.
as.ltable(data.frame)
: data.frame method
as.ltable(table)
: table method
as.ltable(matrix)
: matrix method
Converts data.frame to tabular, then wraps it in specified environments, then wraps result in a latex table environment. Result is returned visibly, or if file
is specified it is printed to file and returned invisibly.
If source
and source.label
are defined, they will be printed in a tiny font immediately under the table (bound to the tabular element). If file
and file.label
are defined as well, they will be printed (tiny) under source. Set source.label
to NULL to suppress embedding of source
; set to empty string to suppress source label. Set file.label
to NULL to suppress embedding of file
; set to empty string to suppress file label. Note that file
controls file destination, whether or not represented in the result.
Extra arguments(...) are passed to as.tabular
.
as.tabular
as.tabular
as.ltable(head(Theoph))
as.ltable(table(1:3,4:6))
Run the code above in your browser using DataLab