Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cbind.huxtable

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, or huxtables.

deparse.level

Unused.

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 isTRUE, then cell properties will be copied to non-huxtables. Objects on the left or above get priority over those on the right or below.

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

NB: You cannot bind huxtables with data frames, since the R method dispatch will always call the data frame method instead of the huxtable-specific code. For a solution, see add_columns().

Value

A huxtable.

Examples

sugar <- c("Sugar", "40%", "35%", "50%")
jams <- set_bold(jams, 1, everywhere)
cbind(jams, sugar)
cbind(jams, sugar,
     copy_cell_props = FALSE)

jams <- set_text_color(jams,
     everywhere, 1, "red")
rbind(jams, c("Damson", 2.30))
rbind(jams, c("Damson", 2.30),
     copy_cell_props = FALSE)

huxtable

Easily Create and Style Tables for LaTeX, HTML and Other Formats

v5.3.0
MIT + file LICENSE
Authors
David Hugh-Jones [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.