parse_date

0th

Percentile

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

ymd, guess_format

Aliases
  • parse_date
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"}
Documentation reproduced from package lubridate, version 0.1, License: GPL

Community examples

Looks like there are no examples yet.