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] "2017-05-13" "2018-11-29" "2016-03-26" "2018-11-03" "2016-03-01"
#>  [6] "2018-04-20" "2019-08-30" "2013-02-15" "2014-06-11" "2020-02-23"
#> [11] "2013-01-03" "2014-02-19"