Description Usage Arguments Value Author(s) Examples
Print LaTeX tables with headings over two lines
1 2 3 | print_2heading_xtable(.data, separator = "__", xtable.align = NULL,
booktabs = TRUE, heading_command = "\\textbf",
xtable.dots = NULL, ...)
|
.data |
A data frame with at least some of the column names having a |
separator |
A regular expression that splits the top and bottom rows. If the separator is not found in the names of |
xtable.align |
Passed to |
booktabs |
Should the tabular environment produced use booktabs? Set to TRUE for (my) convenience. This will cause an error if |
heading_command |
A (simple) LaTeX control sequence (properly escaped) to apply to each heading names. |
xtable.dots |
Arguments passed to |
... |
Arguments passed to |
Output intended for LaTeX. A table produced using xtable where groups of column names are put in the top row.
Hugh Parsonage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | example_df <-
data.frame(yr = 2001:2005,
Revenue__foo = 1:5,
Revenue__bar = 11:15,
Revenue__baz = 21:25,
ordinary = 1:5,
Expense__foo = 1:5,
Expense__bar = 11:15,
Expense__baz = 21:25,
Last__foo = 1:5,
Last__baz = 2:6,
last = 101:105)
print_2heading_xtable(example_df, separator = "__")
print_2heading_xtable(example_df, separator = "__", xtable.dots = list(caption = "My caption"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.