I have data.frame with 100k rows and lots of variables. One variable is "Country", which shows one of 17 countries. Another variable is "Mass".
I also have a vector that lists the 17 unique countries. I'm trying to create a vector that shows the sum of "Mass" for each Country - i.e. a list of 17 numbers showing the total Mass for each Country.
I can do the conditional sum for one specific country, but I can't work out how to create the vector.
Any help is greatly appreciated - many thanks.