Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR R

how to group by 2 variables in r

library(dplyr)

tab %>%
  group_by(month, variable) %>%
  summarise(a_sum=sum(amount),
            a_mean=(mean(amount)))
 
PREVIOUS NEXT
Tagged: #group #variables
ADD COMMENT
Topic
Name
5+6 =