I have a data set with a character column for months (MONTH) and a numeric column indicating years (YEAR). In order to work with it as panel data, I ne
In base R you could do something like:
transform(df,TIME = paste(sprintf('%02d',match(MONTH,toupper(month.abb))),YEAR,sep = '-'))[c(1,5,4)]
STATE TIME VALUE
1 California 01-2018 800
2 California 02-2018 780
3 California 03-2018 600
4 ... NA-... ...
5 Minesota 01-2018 800
6 Minesota 02-2018 780
7 Minesota 03-2018 600