-
Notifications
You must be signed in to change notification settings - Fork 218
Closed
Labels
Milestone
Description
I have been trying to color only NA values without coloring other variables with the data_color function but without success.
There appears to be an inconsistency in the behavior of the row parameter:
library(tidyverse)
library(gt)
dset <- tibble(
temperature = c(1, 2, NA),
pulse = c(NA, 1, 1.2)
)
This does not work
dset %>%
gt() %>%
data_color(rows = is.na(everything()))
Error in `get_contrast_ratio()`:
! At least one color defined for each of `color_1` and `color_2`.~
... but this does
dset %>%
gt() %>%
data_color(rows = is.numeric(everything()))
is.na and is.numeric in my knowledge evaluates to the same logical value(s)
dset %>%
gt() %>%
data_color(rows = where( ~ is.na(.)))
I want to color only the NA values without coloring any other value
Thanks.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done
