Hi,
If your existing date is in character format you can use string functions to get your format.
stringr::str_sub(,1,6) #to get it as yyyymm
Or
paste0(str_sub(,1,4),"-",str_sub(,5,6)) # to get it as yyyy-mm
If your data is already in date format then pls use package lubridate for date manipulation as mentioned by @sirosdad