rand_date: Compute uniformly distributed random dates within intervals...

View source: R/dateFunctions.R

rand_dateR Documentation

Compute uniformly distributed random dates within intervals of dates

Description

Compute uniformly distributed random dates within intervals of dates

Usage

rand_date(startdate, enddate, ...)

Arguments

startdate

A vector of class Date containing the beginning date(s)

enddate

A vector of class Date containing the ending date(s)

...

Additional arguments passed to base::sample

Value

A vector of elements of class Date containing uniformly distributed dates in the closed interval (startdate, enddate).

Author(s)

Steve Gutreuter

See Also

sample seq.Date

Examples

begin <- ymd("2020-06-21", "2021-06-21")
end <- ymd("2020-12-21", "2021-12-21")
rand_date(begin, end)


sgutreuter/SGmisc documentation built on Aug. 25, 2024, 7:21 p.m.