Get random time vector from an interval

random_time_vector(
  size,
  min_time = "00:00:00",
  max_time = "23:59:59",
  resolution = "seconds",
  unique = FALSE
)

Arguments

size

integer, vector length

min_time

character, beginning of the time interval to sample from

max_time

character, ending of the time interval to sample from

resolution

character, one of "seconds", "minutes", "hours", time resolution

unique

boolean, should the output be unique?

Examples

random_time_vector(12, "12:23:00", "15:48:32")
#>  [1] "13H 56M 44S" "14H 34M 50S" "12H 25M 52S" "14H 67M 19S" "12H 59M 37S"
#>  [6] "15H 39M 36S" "15H 24M 6S"  "14H 54M 34S" "14H 31M 13S" "15H 31M 17S"
#> [11] "12H 64M 32S" "13H 79M 50S"