parse_date_col: Parse a Date Column

Description Usage Details See Also Examples

View source: R/date_parsing.R

Description

Parse a Date Column

Usage

1
2
3
4
5
6
7
parse_date_col(
  data,
  col,
  quiet = TRUE,
  tz = NULL,
  locale = Sys.getlocale("LC_TIME")
)

Details

Includes evaluation of the variables as dates with origins of 1900-01-01 and 1970-01-01. Since the evaluation of origin is temperamental (ie 91884 is parsed into a date in 1997 which would be difficult to weed out downstream since it is a realistic date), it is not coalesced with the other parsed columns and is reported separately in the output.

See Also

mutate ymd

Examples

1
2
3
4
5
6
library(tidyverse)
test_data <- tibble(A = c("91884", "", NA, "091884", "09984", "090984", "09/18/1984", "1984-09-18", "9/18/84", "9/9/84", "9-9-84", "9-18-84", "12-18-84"))


test_data %>%
        parse_date_col(A)

meerapatelmd/rubix documentation built on Sept. 5, 2021, 8:30 p.m.