i am sure there is a very simple to the problem, but I am new to R and programming and I just don't see it.
i do have a data frame of the form:
countries<-c("Austria", "Austria", "USA")
date<-c("23.01.2020", "23.01.2020", "01.01.2020")
value<-c(3, 5, 4)
df<-data.frame(cbind(countries, date, value))
and what I want to do is to consolidate the rows that are doubled, same date, same country, and sum up the values for those rows.
I can do it with a loop subsetting the data frame and then doing the calculation by hand. but I am sure there is a simple end far better way to do it.
Especially as my data set is quite large and the loop takes forever. (if there is anything unclear, pls ask)
Many Thanks