0

I want to optionally expand my third column (here, "time") to get aggregate measures (summed over colB values) of some value over time for colA, but still have the option to further expand on colB. So far whatever I try I must expand all preceding cols (colA and colB here) in order to see aggregates by some third item (time).

dat <- data.frame(colA = c(rep("Yes", 20,), rep("No", 20)),
                  colB = rep(c(letters[1:5]), 4)) %>%
  arrange(colA, colB) %>%
  mutate(time = rep(1:4, 10),
         val = runif(40))

reactable(dat,
  groupBy = c("colA", "colB"),
  columns = list(
    val = colDef(aggregate = "sum")
  ),
  bordered = TRUE)

I want to see column "val" according to colA and time, without expanding/seeing values of colB (value is summed over the categories within this column)

toki
  • 936
  • 5
  • 18
bikeactuary
  • 447
  • 4
  • 18

1 Answers1

0

Just learned via package author it is not currently possible, but now has an open enhancement request. See below

https://github.com/glin/reactable/issues/314

bikeactuary
  • 447
  • 4
  • 18