How to merge rows by name

I would like to be able to combine the numeric variables (add them) according to the name of the individual as in the example below. Thanks :slight_smile:

DF_start

Individual X Y Z
1 A 1 10 11
2 A 2 11 12
3 A 3 12 13
4 B 4 13 14
5 B 5 14 15
6 C 6 15 16
7 C 7 16 17
8 C 8 17 18
9 C 9 18 19

DF_result

Individual X Y Z
1 A 6 33 36
2 B 9 27 29
3 C 30 66 70

As a beginner to R you may benefit from studying this useful book.


Particularly chapter 5, learn to group by and summarise

Thank you for pointing me where to search and learn :slight_smile:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.