column_to_header: Convert a column to header rows

column_to_headerR Documentation

Convert a column to header rows

Description

Convert a column to header rows

Usage

column_to_header(
  ht,
  col,
  ...,
  glue = "{value}",
  start_col = 1,
  ignore_headers = TRUE,
  set_headers = TRUE
)

Arguments

ht

A huxtable.

col

A column specifier for a single column.

...

Properties to set on new rows

glue

Glue string. "{value}" will be replaced by the column value.

start_col

Integer. New header text will start at this column.

ignore_headers

Logical. Ignore existing headers?

set_headers

Logical. Set new rows as headers?

Examples

column_to_header(jams, "Type")
column_to_header(jams, "Type", text_color = "red")
column_to_header(jams, "Price",
                   number_format = 2,
                   italic = TRUE,
                   glue = "Price: {value}")

iris_hux <- as_hux(iris[c(1:4, 51:54, 101:104), ])
column_to_header(iris_hux, "Species",
                   markdown = TRUE,
                   glue = "Species: **{value}**"
                 )

huxtable documentation built on June 15, 2022, 5:10 p.m.