ltable.data.frame: Convert a Data Frame to a Latex Table

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Convert data.frame to latex table.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## S3 method for class 'data.frame'
ltable(
	x, 
	caption = NULL, 
	cap = caption, 
	cap.top = TRUE, 
	label = NULL, 
	options = "!htpb", 
	environments = "center", 
	source = NULL,
	file = NULL,
	source.label='source: ',
	file.label='file: ',
	basefile=FALSE,
	footnote.size='tiny',
	...
)
## S3 method for class 'table'
ltable(x,...)
## S3 method for class 'matrix'
ltable(x, caption = names(dimnames(x))[[2]],...)

Arguments

x

data.frame

caption

full version of the caption

cap

short version of the caption, for list of tables

cap.top

Should caption be placed at the top, instead of bottom?

label

optional label

options

options for latex table environment

environments

extra environments to nest between ‘table’ and ‘tabular’.

source

optional source attribution

file

optional file name

source.label

optional text to preceed source if specified

file.label

optional text to preceed file if specified

basefile

if TRUE, strip path from file for display purposes

footnote.size

font size for source and file, etc.

...

passed to tabular

Details

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.

ltable is generic. You can write methods for other classes. ltable.table reclassifies its argument as matrix. ltable.matrix tries to capture the column names as a caption, and (like tabular.matrix) converts its argument to data.frame, capturing rownames as a column in the first position if rownames are suitably named.

as.ltable is an alias for ltable.

Value

character

Author(s)

Tim Bergsma

References

http://metrumrg.googlecode.com

See Also

Examples

1
2

metrumrg documentation built on May 2, 2019, 5:55 p.m.