Good morning
I have a data frame similar to this one
tibble(year = c(rep(2012, 5), rep(2013, 5)),
month = c("April", "April", "June", "June", "July", "April", "April", "April", "August", "August"),
sampler_type = c("A", "A", "B", "B", "B", "A", "A", "A", "B", "B"),
city = c("city_1", "city_1","city_2","city_2","city_3","city_1","city_1","city_2","city_3","city_3"),
var_1 = c(0,0,0,0,150, 325, 523,335, 25, 36),
var_2 = c(122, 12, 654, 321, 321, 0, 0, 0, 0,0),
var_3 = c(0, 0, 0, 321, 154, 214, 214, 0, 0, 0),
var_4 = c(123, 245, 21, 0, 124, 321, 0, 231, 214, 0),
var_5 = c(213, 142, 0, 0, 132, 31, 54, 35, 54, 23))
I would like to summarise data by summing up the rows which have the same month, from the same place and same year, also keeping the info about the "sampler_type" variable.
Thanks for the help