Description Usage Arguments Details Value See Also Examples
Given years, and possibly months and days,
randomly generate a dates.
The dates are generated
from a uniform distribution:
all dates that fall within the range implied by
the year, month, and day arguments
have the same chance of being selected.
For instance, if year
is 2000, month is "March", and
no value is supplied for date, then every date from
"2000-03-01" to "2000-03-31" has the same
1/31 chance of being selected.
1 | impute_date(year, month = NULL, day = NULL)
|
year |
A numeric vector specifying years. Required. |
month |
A numeric or character vector specifying months. Optional. |
day |
A numeric vector specifying days. Optional |
Months can be specified in one of four ways:
Numbers 1, 2, ..., 12
Codes "01", "02", ..., "12"
English full names: "January", "February", ...,
"December"
English abbreviations: "Jan", "Feb", ...,
"Dec"
month and day, if supplied, must have the
same length as year.
A vector of class Date.
1 2 3 4 5 | impute_date(year = 2000:2004)
impute_date(year = 2000:2004,
month = c("Feb", "Jun", "May", "Apr", "Feb"))
impute_date(year = 2000:2004,
day = c(3, 31, 11, 2, NA))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.