Computes the number of years (as a decimal) between a date and a reference date. Useful for calculating time since last gift, years of giving, or other duration metrics.
Usage
years_since(date, as_of = Sys.Date(), digits = 1L)Arguments
- date
Date vector (or coercible via
as.Date()).- as_of
Reference date. Default is today.
- digits
Number of decimal places to round to. Default 1. Use NULL for no rounding.