I have this dataframe:
> names(events)
[1] "EID" "X" "Y" "trip" "tow" "catch" "effort" "depth"
[9] "season"
Where some of my unique ID “EID” appears more than once in 162 cases.
> length(events$EID)-length(unique(events$EID))
[1] 162
I would like to combined each replicate EID together and sum their “catch”.
I’ve been trying a few things with the plyr package… but can’t find a rather straightforward command.
Any tips would be much appreciated!
Thank you very much!
Here is an example that should get you started: