-
Notifications
You must be signed in to change notification settings - Fork 217
Closed
Milestone
Description
Using the cells_summary() location helper function requires use of non-default values to get it to work.
The signature for the function is:
cells_summary(
groups = everything(),
columns = everything(),
rows = everything()
)Here's an MRE which results in an error (expectation is that all summary rows should be styled):
library(gt)
gtcars %>%
gt(rowname_col = "model", groupname_col = "mfr") %>%
summary_rows(
groups = c("Ford", "Ferrari"),
columns = year,
fns = list(`latest year` = ~ max(.)),
formatter = fmt_number,
decimals = 0,
use_seps = FALSE
) %>%
tab_style(
style = list(
cell_fill(color = background_color),
cell_text(color = text_color)
),
locations = cells_summary(groups = everything())
)Error: `everything()` must be used within a *selecting* function.
ℹ See <https://tidyselect.r-lib.org/reference/faq-selection-context.html>.
Run `rlang::last_error()` to see where the error occurred.
With groups in cells_summary(), a vector group ID values must be provided (i.e., groups = "Ferrari" works).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Projects
Status
Done