I'm attempting to use to create a reactive expression which does a group_by() when a certain radio button is False, and does a total aggregation otherwise. I have tried doing this with both ifelse and case_when functions, but have not had any success. Any tips/ideas?
Ultimately I am trying to pipe this into a gt table which will again show split out via tab_stubhead() by group if the the radio button if false, and total aggregation otherwise.
Hi, the group_by() can be left blank and the summarization will be done for the entire data set. Using this capability, you can use rlang to create a function that passes the grouping variable, something like this: