parse_date
From lubridate v0.1
by Hadley Wickham
Change dates into a POSIXct format...
Change dates into a POSIXct format
- Keywords
- chron
Usage
parse_date(x, formats, seps=find_separator(x))
Arguments
- x
- a character or numeric vector of suspected dates
- formats
- a vector of date-time format elements in the order they occur within the dates.
See
strptime
for format elements. - seps
- a vector of possible characters used to separate elements within the dates.
Details
parse_date is an internal function for the ymd
family
of functions. Its recommended to use these functions instead. It
transforms dates stored in character and numeric vectors to POSIXct
objects. All inputed dates are considered to have the same order and
to use the same separator.
Value
- a vector of POSIXct date-time objects
See Also
Examples
x <- c("09-01-01", "09-01-02", "09-01-03")
parse_date(x, c("%y", "%m", "%d"), seps = "-")
# "2009-01-01 UTC" "2009-01-02 UTC" "2009-01-03 UTC"
ymd(x)
# "2009-01-01 UTC" "2009-01-02 UTC" "2009-01-03 UTC"}
Community examples
Looks like there are no examples yet.