date_from_lag | R Documentation |
Generates an initial date from a reference date and a time lag in months
date_from_lag(date = character(), time_lag = integer())
date |
a date with format yyyy-mm-dd |
time_lag |
an integer representing a number of months |
a date which is time_lag months before or after date depending on the sign of time_lag
seq_dates <- seq(as.Date("2020-01-01"), as.Date("2020-12-01"), by = "1 month") data.frame(date = seq_dates, lagged_date = date_from_lag( date = seq_dates, time_lag = -2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.