View source: R/subtract_years.R
subtract_years | R Documentation |
Subtract a number of years from a date
subtract_years(date, n_years)
date |
Date from which to subtract |
n_years |
Number of years to subtract. Will be coerced to integer - cannot subtract fractions of a year. |
subtract_years(Sys.Date(), 5)
subtract_years(as.Date("2020-01-01"), 1)
## Not run:
# This returns an error:
subtract_years(Sys.Date(), 1.5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.