I want to pass a flag to a reactive function that takes several variables selected by the user and gives me a summary table with means and p-values grouped by those variables (i.e., means for interactions of covariates 1, 2, … n). But then I also have a pivot table, for which I want to select only the first two covariates. To do that, I want to pass my reactive function (that returns the table of means) a flag from the function that generates the pivot table. Something like:
get_summary_data <- reactive(pivot_flag = FALSE,
{
# calculate stuff
# if !pivot_flag: select only the first two variables from raw data
# else: select all of them
# calculate stuff, aggregate into summary_data
summary_data
}
)
Thanks!