I have a table that looks like this:
ID c1 c2 c3 c4
A 23 12 45 63
A 3 1 6 17
B 3 1 4 6
B 2 2 5 3
and I would like to get something like this,
ID c1 c2 c3 c4
A 26 13 51 80
B 5 3 9 9
where each cell is the sum of the values ββthat are mapped to the same identifier.
I would like to solve this with R. Any thoughts? I know that if they want to sum all the values ββin a column, I can use colsums, but I'm not sure how to sum the values ββbased on the criteria.
Any help would be appreciated.
Frame
PS: the actual table, I have 45000 rows and 72 columns.
source
share