-
Notifications
You must be signed in to change notification settings - Fork 217
Closed
Description
With gt 0.10.0.9000,
we can have
d <- mtcars |> dplyr::slice_head(n = 10)| row_group_as_columns = FALSE | row_group_as_columns = TRUE |
|---|---|
gt::gt(d, groupname_col = "vs") |
gt::gt(d, groupname_col = "vs", row_groups_as_columns = TRUE) |
![]() |
![]() |
Currently, opt_interactive() hides the vs groupname_col column regardless.
Here is my suggestion with reactable::reactable()
# use `colDef()` to hide column name
# use rownames = FALSE since we are using a different column as row names
# From https://github.com/glin/reactable/issues/94
grp_fn = reactable::JS("
function(cellInfo) {
return cellInfo.value
}")
mtcars |> dplyr::slice(1:10) |>reactable::reactable(groupBy = "vs",defaultExpanded = T, rownames = FALSE, columns = list(vs = reactable::colDef(name = "", grouped = grp_fn)))I don't see a good solution for row_group_as_columns = T as I couldn't find an example of reactable merging a column, but would still be an improvement.
Reactions are currently unavailable


