merge_across creates multicolumn cells within each row. merge_down creates multirow cells within each column.

merge_across(ht, row, col)

merge_down(ht, row, col)

Arguments

ht

A huxtable.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

Value

The ht object.

See also

Other cell merging: merge_cells(), merge_repeated_rows()

Examples

ht <- as_hux(matrix(1:12, 4, 3, byrow = TRUE)) ht <- set_all_borders(ht, 1) merge_across(ht, 2:4, 2:3)
#> ┌───────┬───────┬───────┐ #> │ 1 │ 2 │ 3 │ #> ├───────┼───────┴───────┤ #> │ 4 │ 5 │ #> ├───────┼───────────────┤ #> │ 7 │ 8 │ #> ├───────┼───────────────┤ #> │ 10 │ 11 │ #> └───────┴───────────────┘ #> #> Column names: V1, V2, V3
merge_down(ht, 2:4, 2:3)
#> ┌───────┬───────┬───────┐ #> │ 1 │ 2 │ 3 │ #> ├───────┼───────┼───────┤ #> │ 4 │ 5 │ 6 │ #> ├───────┤ │ │ #> │ 7 │ │ │ #> ├───────┤ │ │ #> │ 10 │ │ │ #> └───────┴───────┴───────┘ #> #> Column names: V1, V2, V3