View source: R/gt_alert_icon.R
gt_alert_icon | R Documentation |
Insert an alert icon to a specific column
gt_alert_icon(
gt_object,
column,
palette = c("#a962b6", "#f1f1f1", "#378e38"),
domain = NULL,
height = "10px",
direction = 1,
align = "center",
v_pad = -5
)
gt_object |
An existing gt table object of class |
column |
The column wherein the numeric values should be replaced with circular alert icons. |
palette |
The colours or colour function that values will be mapped to. Can be a character vector (eg |
domain |
The possible values that can be mapped. This should be a simple numeric range (e.g. |
height |
A character string indicating the height in pixels, like "10px" |
direction |
The direction of the |
align |
Character string indicating alignment of the column, defaults to "left" |
v_pad |
A numeric value indicating the vertical padding, defaults to -5 to aid in centering within the vertical space. |
a gt table
head(mtcars) %>% dplyr::mutate(warn = ifelse(mpg >= 21, 1, 0), .before = mpg) %>% gt::gt() %>% gt_alert_icon(warn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.