I am writing a simple wrapper for gt_sparkline() for {gtsummary} tables. One issue I ran into was that the gt_sparkline(column=) argument couldn't accept the rlang .data prefix. The update also allows users to utilize tidyselect selectors. Example below!
library(gt)
mtcars %>%
dplyr::group_by(cyl) %>%
# must end up with list of data for each row in the input dataframe
dplyr::summarize(mpg_data = list(mpg), .groups = "drop") %>%
gt() %>%
gt_sparkline(.data$mpg_data)
Hello!
I am writing a simple wrapper for
gt_sparkline()
for {gtsummary} tables. One issue I ran into was that thegt_sparkline(column=)
argument couldn't accept the rlang.data
prefix. The update also allows users to utilize tidyselect selectors. Example below!