I\'m trying to use dplyr to summarize a dataset based on 2 groups: \"year\" and \"area\". This is how the dataset looks like:
Year Area Num 1 2000 Area 1 99
We can use data.table
data.table
library(data.table) setDT(df)[, .(avg = mean(Num)) , by = .(Year, Area)]