I have the data frame:
x=c("a","a","b","b","b","c","c","d","e","f","f")
y=c(2,3,6,2,5,6,2,1,4,3,2)
df=data.frame(x,y)
How do I create a new date frame that lists the letter from column x and then gives the sum of the values from column y? This is what I want to create:
x y
1 a 5
2 b 13
3 c 11
4 d 2
5 e 4
6 f 5