LTable: Make LaTeX table code from R objcts.

Description Usage Arguments Details Author(s) Examples

Description

This function makes LaTeX table code from R objcts.

Usage

1
LTable(..., caption = "", label = "", indent = F, file = "")

Arguments

...

can be matrices, data.frames, or lists of matrices or data.frames.

caption

a character string of the caption.

label

a character string of the label.

indent

a boolean indicating if indent.

file

a connection, or a character string naming the file to print to. If "" (the default), ltable prints to the standard output connection, the console unless redirected by sink. If it is "|cmd", the output is piped to the command given by 'cmd', by opening a pipe connection.

Details

The function saves LaTeX users' time for writing tables. It uses directly the results from R to produce LaTeX table code.

The function handels values in ... in the following way:

Elements in ... will be binded by row.

If an element in ... is a list, then its element will be binded by column.

Missing values will be filled by empty character "".

Author(s)

Yukai Yang, yukai.yang@statistik.uu.se

Examples

1
2
3
4
x = matrix(rnorm(9),3,3)
y = data.frame(a=c('a','b','c','d'),b=1:4)
z = matrix(0,2,5)
LTable(y,caption="Hello!",list(round(x,2),z),label="tab:hi",indent=TRUE)

yukai-yang/LTable documentation built on May 14, 2019, 6:03 p.m.