Learn R Programming

huxtable (version 4.2.1)

rowspan: Row and column span

Description

Functions to get or set the row and column span property of huxtable cells.

Usage

rowspan(ht)
rowspan(ht) <- value
set_rowspan(ht, row, col, value, byrow = FALSE)

colspan(ht) colspan(ht) <- value set_colspan(ht, row, col, value, byrow = FALSE)

Arguments

ht

A huxtable.

value

An integer vector or matrix. Set to NA to reset to the default, which is 1.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

byrow

If TRUE, fill in values by row rather than by column.

Value

For rowspan, the rowspan property. For set_rowspan, the ht object.

Details

The rowspan and colspan of a cell determine its height and width, in rows and columns. A cell with rowspan of 2 covers the cell directly below it. A cell with rowspan of 2 and colspan of 2 covers a 2 x 2 square, hiding three other cells.

Examples

Run this code
# NOT RUN {
ht <- huxtable(a = 1:3, b = 1:3)
rowspan(ht)[1, 1] <-  2
rowspan(ht)
ht <- set_all_borders(ht, 1) 
ht
# }

Run the code above in your browser using DataLab