cbind.huxtable {huxtable}R Documentation

Combine rows or columns

Description

Combine rows or columns

Usage

## S3 method for class 'huxtable'
cbind(..., deparse.level = 1, copy_cell_props = TRUE)

## S3 method for class 'huxtable'
rbind(..., deparse.level = 1, copy_cell_props = TRUE)

Arguments

...

Vectors, matrices, data frames or huxtables.

deparse.level

Passed to cbind.data.frame().

copy_cell_props

Cell properties to copy from neighbours (see below).

Details

Table properties will be taken from the first argument which is a huxtable. So will row properties (for cbind) and column properties (for rbind).

If some of the inputs are not huxtables, and copy_cell_props is a character vector of cell properties, then for rbind, the named cell properties and row heights will be copied to non-huxtables. For cbind, the named cell properties and column widths will be copied. Objects on the left or above get priority over those on the right or below.

If copy_cell_props is TRUE, the default set of cell properties (everything but colspan and rowspan) will be copied.

If copy_cell_props is FALSE, cells from non-huxtable objects will get the default properties.

Value

A huxtable.

Examples

ht1 <- hux(a = 1:3, b = 4:6)
ht2 <- hux(d = letters[1:3], e = letters[4:6])
bold(ht1)[1,] <- TRUE
bold(ht2) <- TRUE
vec <- LETTERS[1:3]

ht_out <- cbind(ht1, vec, ht2)
ht_out
bold(ht_out)
bold(cbind(ht1, vec, ht2, copy_cell_props = FALSE))


[Package huxtable version 4.0.1 Index]