try_parse_date: Parse Date If Necessary

Description Usage Arguments Value Examples

Description

Since atomic objects can only have one type, it is unnecessary to check the type of each element in the vector. This function checks the type on the vector level to determine whether it needs to operate parse_date_time for d on a vectorized basis.

Usage

1

Arguments

d

vector of elements that may or may not be type Date

Value

Date type vector with NA for a particular element in d if it were not parsable

Examples

1
2
try_parse_date(as.Date(c("2015-01-01","2015-08-08")))
try_parse_date(c("2015-01-01","blah"))

Tsunamical28/mdpr documentation built on May 9, 2019, 5:15 p.m.