Skip to contents

Color the background cells based on how the value compares to the project average. The project average must be the last row of the table. A footnote is added to the table describing what the dark and light colors mean.

Usage

format_ft_colors(
  ft,
  lighter_color = "#F2F0E6",
  darker_color = "#ccc29c",
  language = "English"
)

Arguments

ft

Flextable object

lighter_color

Lighter background color. Defaults to WaSHI cream.

darker_color

Darker background color. Defaults to WaSHI tan.

language

Language of the footnote. "English" (default) or "Spanish".

Examples

# Read in wrangled example table data
tables_path <- soils_example("tables.RDS")
tables <- readRDS(tables_path)

# Make the table
ft <- flextable::flextable(tables$biological)
ft
# Conditionally format background cell colors format_ft_colors(ft)