I have this dataset saved as a matrix named s2
[,1]
0 4
0.5 1
1 6
10 61
15 28
2 8
20 25
23 1
25 4
3 3
30 44
I wanted to group them by the names of their rows to get this for example
[,1]
0-10 22
10-20 89
20-30 30
30-40 48
I was wondering if there were another way (faster since my dataset is much bigger than this) than s[1,]=s[1,]+s2[2,]+..
and then deleting all rows ?
I tried with aggregate
, and I read something about wordStem()
but I couldn't get anywhere.
Thank you