I have a data frame which looks like this:
ID Age
1 19
2 20
3 56
4 81
I want to add up the column age and comma delimit ID:
ID Age
1,2,3,4 176
I have tried this:
aggregate(ID ~., data, toString)
as per this solution:
Collapse / concatenate / aggregate a column to a single comma separated string within each group
But, this is not producing desired result.