Hi I want to find the nearest month end for a date column in R.
Is there any efficient way to do this?
dt<-data.frame(orig_dt=as.Date(c("1997-04-01",
"1997-06-29"
)))
dt<-dt %>% mutate(modified_dt="Nearest_month_end_date")
ie 1997-04-01 should change to 1997-03-31 and 1997-06-29 should change to 1997-06-30.