kable_im: The Improvement of 'knitr::kable' Function

Description Usage Arguments Details Value

Description

The improved and customized version of the 'kable' function which is used to generated Latex table. Generally speaking, it add more customization options.

Usage

1
2
kable_im(data, caption, split = TRUE, ignore = 1, align = "c",
  align.str = "", font.size = "")

Arguments

data

data.frame, the table wait to be converted to Latex code

caption

character, the caption of the table

split

logical, whether to split the header to tow lines

ignore

numeric, which column(s) to be ignored when splitting

align

character, how to align the columns, "c", "r" or "custom"

align.str

if align is set to "custom", the customized the alignment should be given here

font.size

the Latex code of font size can be set directly here, e.g. "\small"

Details

The function uses kable to generate table in the **table** environment, but lack of customization of the table style. This funcion adds the following options:

- The font size can be directly input to the final Latex code.

- Set or give the alignment option of the table columns. Like "l|c|c|r".

- Split the header to tow lines, which will solve the wide table to be located inside the text area.

Value

The LaTex code of the table will be output using cat, thus it can be copied to Latex file or used in **knitr**, where set result='asis', the same way as using kable.


baixueyuan/pryrk documentation built on May 11, 2019, 5:26 p.m.