-1
我有數據幀:如何查找R中某個數據幀內的值的總和?
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)
如何創建一個新的日期框列出從x列的字母,然後給出了值從y列的總和?這是我想創造什麼:
x y
1 a 5
2 b 13
3 c 11
4 d 2
5 e 4
6 f 5