how to group by 2 variables in r code example
Example: how to group by 2 variables in r
library(dplyr)
tab %>%
group_by(month, variable) %>%
summarise(a_sum=sum(amount),
a_mean=(mean(amount)))
library(dplyr)
tab %>%
group_by(month, variable) %>%
summarise(a_sum=sum(amount),
a_mean=(mean(amount)))