I'm using the reactable
package in R to display data sorted by multiple groups.
Is there a way to display the sum of all counts of all given subgroups?
Here is an example:
data("diamonds")
diamonds$id <- 1:nrow(diamonds)
reactable::reactable(data = diamonds[1:1000, c("cut", "color", "id")],
striped = TRUE,
highlight = TRUE,
bordered = TRUE,
showPageSizeOptions = TRUE,
groupBy = c("cut", "color"),
columns = list(
id = reactable::colDef(aggregate = "count")
))
So the first row in the ID column refers to the 7 subgroups in the ideal
group.
Instead of showing the amount of existing subgroups I want reactable to display the sum of all subgroup counts in the first row. So sum(67, 7, 42, 57, 46, 73, 41)
Is there a way to do this?