Skip to contents

Calculates the previous year dates by subtracting one year from the given dates.

Usage

py_dates(dates, ...)

Arguments

dates

a date-time object of class POSIXlt, POSIXct or Date.

...

Arguments passed on to lubridate::add_with_rollback

roll_to_first

rollback to the first day of the month instead of the last day of the previous month (passed to rollback())

preserve_hms

retains the same hour, minute, and second information? If FALSE, the new date will be at 00:00:00 (passed to rollback())

Value

A vector of dates one year prior to the input dates. Any fictitious resulting dates (e.g. the result of subtracting a year from a leap day) are rolled back to the prior valid date.