Get random date vector from an interval

random_date_vector(size, min_date, max_date, format = NULL, unique = FALSE)

Arguments

size

integer, vector length

min_date

character or date, beginning of the time interval to sample from

max_date

character or date, ending of the time interval to sample from

format

character, check strptime for details

unique

boolean, should the output be unique?

Examples

random_date_vector(12, "2012-12-04", "2020-10-31")
#>  [1] "2016-04-03" "2019-02-22" "2017-02-04" "2017-08-07" "2015-07-21"
#>  [6] "2018-10-26" "2013-10-29" "2017-05-10" "2018-05-17" "2013-06-18"
#> [11] "2020-02-18" "2016-04-27"