Having some trouble coming up with an approach to solving this problem. Given this data set (which, in real life has lots more observations and far more variables than just these five),
# Name Team H AB BA # 1 Mookie Betts BOS 7 20 0.350 # 2 Kevin Pillar TOR 10 27 0.370 # 3 Kevin Pillar SFG 2 12 0.167 # 4 Xander Bogaerts BOS 9 32 0.281
I'd like to come up with this:
# Name Team H AB BA # 1 Mookie Betts BOS 7 20 0.350 # 2 Kevin Pillar --- 12 39 0.308 # 3 Xander Bogaerts BOS 9 32 0.281
Note the grouping by Name and the consolidation of the data from multiple rows into just one.
I tried grouping and summarizing without much luck. My next thought was perhaps to develop subtotals for duplicate observations and then delete the individual observations, but here again kept running into a wall. Usually, the more outlandish my solution, the more I realize I'm overlooking something obvious.
Appreciate any and all guidance! Thank you,.