huxtable (version 4.6.0)

background_color: Background color

Description

Functions to get or set the background color property of huxtable cells.

Usage

background_color(ht)
background_color(ht) <- value
set_background_color(ht, row, col, value, byrow = FALSE)
map_background_color(ht, row, col, fn)

Arguments

ht

A huxtable.

value

A character vector or matrix of valid R color names.

Set to NA to reset to the default, which is NA.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

fn

A mapping function. See mapping-functions for details.

byrow

Deprecated. Use by_cols() instead.

Value

For background_color, the background_color property. For set_background_color and map_background_color, the modified huxtable.

See Also

Other formatting functions: bold, font_size, font, na_string, number_format, text_color

Examples

Run this code
# NOT RUN {
background_color(jams) <-  grey(.95)
background_color(jams)


set_background_color(jams, grey(.95))
set_background_color(jams,
      2:3, 1, grey(.95))
map_background_color(jams,
      by_rows(grey(.95), "yellow"))
# }

Run the code above in your browser using DataCamp Workspace