date <- ymd("2010-03-03")
rollbackward(date)
dates <- date + months(0:2)
rollbackward(dates)
date <- ymd_hms("2010-03-03 12:44:22")
rollbackward(date)
rollbackward(date, roll_to_first = TRUE)
rollbackward(date, preserve_hms = FALSE)
rollbackward(date, roll_to_first = TRUE, preserve_hms = FALSE)
Run the code above in your browser using DataLab