add_year: Add or subtract years to a given date character.

View source: R/rutils.R

add_yearR Documentation

Add or subtract years to a given date character.

Usage

add_year(input_date, num_years = 1)

Arguments

num_years

(numeric or integer): Number of years to be added to the given date. It can be a negative number.

Value

(character): date pointing to the same day and month of the input date with years added

Examples

add_year('2012-06-11', 3)
[1] "2015-06-11"
add_month('2010-03-12', -6)
[1] "2004-03-12"


genpack/gener documentation built on March 14, 2023, 9:52 a.m.