-
Notifications
You must be signed in to change notification settings - Fork 217
Closed
Milestone
Description
Description
In #1301, @rich-iannone and I realized that the documentation for the na_color argument in gt::data_color() could be improved to clarify that it is ignored when the user specifies an argument to fn.
A suggested update is to add something to the documentation like:
@param na_color [...] ignored if the user specifies the value of `fn`, in which case the argument to `fn` should specify the color of NA arguments
Reproducible example
The code below is what I tried that I expected would work, but didn't.
library(gt)
sza |>
dplyr::filter(latitude == 20 & tst <= "1200") |>
dplyr::select(-latitude) |>
dplyr::filter(!is.na(sza)) |>
tidyr::spread(key = "tst", value = sza) |>
gt(rowname_col = "month") |>
data_color(
fn = scales::col_numeric(
palette = c("red", "white", "green"),
domain = c(0, 50, 100)
),
na_color = "white" # <- Color NA cells to be white (does not seem to do anything)
)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Projects
Status
Done