I know there are a lot of similar-sounding questions out there, but they all relate to quite tailored and detailed processes.
My question is very basic: I want to sum 'amount' for every 'individual'.
d <- data_frame(individual = c("a","a","a","b","c","c","d","d","d","e","f","f","g"),
amount = c("10.4","4.3","3.4","9.2","1.5","4.3","2.6","9.1","4.3","2.0","2.9","6.5","0.8"))
In my real dataset, there are thousands of individuals. Each individual will have between 1 or more values for 'amount'.
My goal is a dataframe with only one row per individual. I've tried pivot_wider to spread these multi-row 'amount' observations into new variables but the data is such that it's not really an option. And I've since been informed that a sum of the observations of 'amount' per 'individual' would be sufficient level of detail for the purpose.