A date should always have a given day, therefore consider to add the day at the end of YYYYMM
(in the example below 01
the first day of the month). Convert the numeric
value to character
and the character
to a Date
:
as.Date(paste0(as.character(201603), '01'), format='%Y%m%d')