gt_hulk_color: Apply 'hulk' palette to specific columns in a gt table. The...

View source: R/gt_hulk_color.R

gt_hulk_colorR Documentation

Apply 'hulk' palette to specific columns in a gt table. The hulk names comes from the idea of a divergin purple and green theme that is colorblind safe and visually appealing. It is a useful alternative to the red/green palette.

Description

Apply 'hulk' palette to specific columns in a gt table. The hulk names comes from the idea of a divergin purple and green theme that is colorblind safe and visually appealing. It is a useful alternative to the red/green palette.

Usage

gt_hulk_color(gt_object, ..., domain = NULL, trim = FALSE, reverse = FALSE)

Arguments

gt_object

An existing gt table object

...

columns to apply color to

trim

trim the palette to give less intense maximal colors

reverse

reverse the color palette. The default is green = high and purple = low, but reverse = TRUE will make purple high and green low.

Value

Returns a gt table

Examples

 # basic use
 mtcars |>
   head() |>
   gt::gt() |>
   gt_hulk_color(mpg)

 mtcars |>
   head() |>
   gt::gt() |>
   # trim gives small range of colors
   gt_hulk_color(mpg:disp, trim = TRUE)

 # option to reverse the color palette
 mtcars |>
   head() |>
   gt::gt() |>
   # trim gives small range of colors
   gt_hulk_color(mpg:disp, rev = TRUE)

jthomasmock/espnscrapeR documentation built on Feb. 11, 2024, 4:07 p.m.