library(magrittr)
library(dplyr)
Theoph %<>% group_by(Subject, Time)
Theoph %>% group_vars
Theoph %>% decorations_groups # nothing!
Theoph %<>% decorate_groups
Theoph %>% decorations_groups # something!
Theoph %<>% ungroup
Theoph %>% group_vars # gone!
Theoph %<>% group_by(across(all_of(decorations_groups(.))))
Theoph %>% group_vars # recovered!
Theoph %<>% group_by_decorations
Theoph %>% group_vars # same
rm(Theoph)
Run the code above in your browser using DataLab