View source: R/DateManipulation.R
AddDate | R Documentation |
Function to add a number of days, months and years to a specific date.
AddDate(date = Sys.Date(), addDays = 0, addMonths = 0, addYears = 0)
date |
Initial date. |
addDays |
If specified, vector number of days to add to the initial date. |
addMonths |
If specified, vector number of months to add to the initial date. |
addYears |
If specified, vector number of years to add to the initial date. |
The output is a vector of final dates after adding the number of days, months and years to the initial date.
Julian Chitiva, Diego Jara and Juan Pablo Bermudez
# Date input as Date object
AddDate(date = Sys.Date(),addDays=14,addMonths=2,addYears=3)
# Date input as character object
AddDate(date = '2019-10-04',addDays=14,addMonths=2,addYears=3)
# Date vectors to add to initial date
AddDate(Sys.Date(), addDays = c(1,2), addMonths = c(4,5),addYears = c(5,6))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.