Spanning labels to identify groups of rows or columns
Description
Spanning labels to identify groups of rows or columns
Usage
group_tt(x, i = NULL, j = NULL, indent = 1, ...)
Arguments
x
A data frame or data table to be rendered as a table.
i
A vector of labels with length equal to the number of rows in x, or a named list of row indices to group. The names of the list will be used as labels. The indices represent the position where labels should be inserted in the original table. For example,
i=list(“Hello”=5): insert the "Hello" label after the 4th row in the original table.
i=list(“Hello”=2, “World”=2): insert the two labels consecutively after the 1st row in the original table.
i=list(“Foo Bar”=0): insert the label in the first row after the header.
j
A named list of column indices to group. The names of the list will be used as labels. See examples below. Note: empty labels must be a space: " ".
indent
integer number of pt to use when indenting the non-labelled rows.
…
Other arguments are ignored.
Details
Warning: The style_tt() can normally be used to style the group headers, as expected, but that feature is not available for Markdown and Word tables.
Value
An object of class tt representing the table.
Word and Markdown limitations
Markdown and Word tables only support these styles: italic, bold, strikeout. The width argument is also unavailable Moreover, the style_tt() function cannot be used to style headers inserted by the group_tt() function; instead, you should style the headers directly in the header definition using markdown syntax: group_tt(i = list(“italic header” = 2)). These limitations are due to the fact that there is no markdown syntax for the other options, and that we create Word documents by converting a markdown table to .docx via the Pandoc software.