I have a data frame simmilar to the one below and would like to compare the maximum value of year / month to the current year month. Problem is that for max(month) I get back 12 (obviously) and for the combined max year / month I get 2020_12. But what I need is the max value of the combined year / month (so 2020_03)
df <- data.frame(ID = c(1:6),
year = c(2019,2019,2019,2020,2020,2020),
month = c(10,11,12,1,2,3))
Anyone has an easy solution?