I have a variable in which column 1 is a list of fish names and column 2 is the number of that species caught. There are many repeated fish in column 1 and corresponding catch counts in column 2 (from different sampling/catch instances).
I would like to merge together repeated fish names and sum their corresponding catch counts - so that there are no repeats and each fish has a single integer pair equaling the total number caught.
Variable visualized:
Column 1 | Column 2 |
---|---|
Fish 1 | 10 |
Fish 2 | 5 |
Fish 1 | 5 |
Fish 3 | 1 |
Fish 1 | 5 |
Fish 2 | 3 |
New desired variable visualized:
Column 1 | Column 2 |
---|---|
Fish 1 | 20 |
Fish 2 | 8 |
Fish 3 | 1 |
Not sure where to begin, looking for any guidance/help.