Say I have two data frames:
d1 = data.frame(table(c(1,2,2,2,4,5))) d2 = data.frame(table(c(2,2,2,6)))
Frame compression with rbind yields the following:
> rbind(d1, d2) Var1 Freq 1 1 1 2 2 3 3 4 1 4 5 1 5 2 3 6 5 1
But I would like to calculate the sum of Freq values ββwith the same Var1 , i.e. get
Var1 Freq 1 1 1 2 2 6 3 4 1 4 5 1 5 6 1
How can i do this?
source share