R: Merge a range of cells

merge_cells {huxtable} | R Documentation

## Merge a range of cells

### Description

Merge a range of cells

### Usage

    merge_cells(ht, row, col)

### Arguments

`ht` | A huxtable.
`row` | A row specifier. See `rowspecs` for details. Only the minimum and maximum rows and columns are used.
`col` | A column specifier.

### Details

`merge_cells(ht, c(min_row, max_row), c(min_col, max_col))` is equivalent to

      colspan(ht)[min_row, min_col] <- max_col - min_col + 1
      rowspan(ht)[min_row, min_col] <- max_row - min_row + 1

There is no way to merge cells that do not form a rectangle, so e.g. `merge_cells(ht, where(ht > 0))` will usually have unexpected results.

### Value

The `ht` object.

### Examples

    ht <- hux(a = 1:3, b = 1:3)
    ht <- set_all_borders(ht, 1)
    merge_cells(ht, 1:2, 1:2)

[Package huxtable version 4.2.0 Index]