parse_dates: Parse Date and Date-Time Variables

Description Usage Arguments Details Value Author(s) Examples

View source: R/parse_dates.R

Description

Given a vector of dates or date-times, create Date or POSIXct variables.

Usage

1
parse_dates(x, tz = getOption("pkdata.tz", ""))

Arguments

x

character vector of dates or date-times

tz

character string; specifies the time zone to be used for the conversion. Defaults to the current time zone.

Details

parse_dates calls parse_date_time from the lubridate package. While parse_date_time accepts multiple date formats, parse_dates requires a consistent format.

Value

vector of Date or POSIXct objects

Author(s)

Cole Beck

Examples

1
2
3
4
x <- c("2014-01-15", "20140202")
parse_dates(x)
x <- c("2014-01-15 01:51", "20140202 04:35:18")
parse_dates(x)

pkdata documentation built on Oct. 23, 2020, 6:19 p.m.