split-across-down | R Documentation |
These functions split a huxtable horizontally or vertically, and return the new sub-tables in a list.
split_across(ht, after, height, headers = TRUE)
split_down(ht, after, width, headers = TRUE)
ht |
A huxtable. |
after |
Rows/columns after which to split. See rowspecs for details.
Note that tidyselect semantics are allowed
in |
height , width |
Maximum height/width for the result. |
headers |
Logical. Take account of header rows/columns? |
Only one of after
and width
or height
must be given. If width
or
height
is given, the huxtable will be split by col_width()
or
row_height()
, which must be numeric with no NA
values.
If headers
is TRUE
, all previous headers will be added to each
new table.
A list of huxtables.
restack-across-down
ht <- as_hux(matrix(LETTERS[1:16], 4, 4))
ht <- set_all_borders(ht)
split_across(ht, after = 2)
split_down(ht, after = c(1, 3))
col_width(ht) <- c(0.15, 0.1, 0.25, 0.3)
split_down(ht, width = 0.3)
# split by column name:
split_down(jams, "Type")
# headers are repeated:
split_across(jams, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.