A data frame, data table, or tibble to be rendered as a table.
i
Character vector, named list, or integer vector
A character vector of labels with length equal to the number of rows in x
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.
Vector of positive integers: For matrix insertion: i specifies row positions and j must be a character matrix to insert in the table (see below for details).
j
String, named list, or character matrix
Named list of column indices to group, ex: j=list(“A”=1:2,“B”=3:6). The names of the list will be used as labels. See below for more examples. Note: empty labels must be a space: " ".
A single string when column names include the group name as a prefix, ex: group1_column1, group1_column2, etc.
Character matrix for inserting rows at positions specified by i. The matrix must have the same number of columns as the table, or be a single column with a number of elements that is a multiple of the table’s column count (which will be automatically reshaped). Each row of the matrix matches an element
Unquoted expression: Non-standard evaluation is supported. When supplying an unquoted expression, it is first evaluated in the calling environment, then in the data frame passed to tt().
…
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.
Markdown limitations
Markdown is a text-only format that only supports these styles: italic, bold, strikeout. The width argument is also unavailable. These limitations exist because there is no standard markdown syntax for the other styling options.
However, in terminals (consoles) that support it, tinytable can display colors and text styles using ANSI escape codes by setting theme_markdown(ansi = TRUE). This allows for rich formatting in compatible terminal environments.
Word limitations
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 we create Word documents by converting a markdown table to .docx via the Pandoc software, which requires going through a text-only intermediate format.