make_date {ugatsdb} | R Documentation |
Coerce Vectors to Dates
Description
This function coerces date strings i.e. "YYYY-MM-DD"
or "YYYY-MM"
, years e.g. 2015
(numeric or character),
year-quarters e.g. "2015Q1"
or "2015-Q1"
, year-months e.g. "2015M01"
or "2015-M01"
, fiscal years e.g. "1997/98"
or numeric values representing dates (e.g. previously imported Excel date) to a regular R date.
Usage
make_date(x, end = FALSE, origin = "1899-12-30")
Arguments
x |
a character date string |
end |
logical. |
origin |
a date or date-string that can be used as reference for converting numeric values to dates. The default corresponds to dates generated in Excel for Windows. See |
Value
A Date
vector.
See Also
Examples
make_date("2011-05")
make_date(2011)
make_date("2011/12")
make_date("2011/12", end = TRUE)
make_date("2011Q1")
make_date("2011Q1", end = TRUE)