[Solved] Merge rows with same names and sum other values in other column rows [duplicate]
We could first group_by country and then use summarise with across library(dplyr) df %>% group_by(country) %>% summarise(across(everything(), sum)) Output: country new_persons_vac~ total_persons_v~ new_persons_ful~ total_persons_f~ new_vaccine_dos~ total_vaccine_d~ <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> 1 Afghan~ 294056 8452317 163535 2313338 457591 10765655 2 Albania 601152 27639676 465433 18105836 459226 45745512 3 Andorra 40569 360995 25838 144358 … Read more