I am trying to use tidyselect() functions within the data_color() function of gt.
This works:
library(tidyverse)
library(gt)
iris %>% group_by(Species) %>%
summarize(across(everything(), mean)) %>%
gt() %>%
data_color(columns = vars(Sepal.Length, Sepal.Width),
colors = scales::col_numeric(palette = paletteer::paletteer_d(palette = "ggsci::red_material") %>% as.character(),
domain = NULL))
And I had expected this would be identical:
iris %>% group_by(Species) %>%
summarize(across(everything(), mean)) %>%
gt() %>%
data_color(columns = vars(starts_with('Sepal')),
colors = scales::col_numeric(palette = paletteer::paletteer_d(palette = "ggsci::red_material") %>% as.character(),
domain = NULL))
but instead I get the error "Error: Can't convert a call to a string".
What am I missing?