extract: Extracting components from messy dates

Description Usage Arguments Value Examples

Description

These functions allow the extraction of particular date components from messy dates, such as the year(), month(), and day(). precision() allows for the identification of the greatest level of precision in (currently) the first element of each date.

Usage

1
2
3
4
5
6
7
year(x)

month(x)

day(x)

precision(x)

Arguments

x

A messydt object

Value

year(), month(), and day() extraction return the integer for the requested date component. precision() returns the level of greatest precision for each date.

Examples

1
2
3
4
year(as_messydate(c("2012-02-03","2012","2012-02")))
month(as_messydate(c("2012-02-03","2012","2012-02")))
day(as_messydate(c("2012-02-03","2012","2012-02")))
precision(as_messydate(c("2012-02-03","2012","2012-02")))

messydates documentation built on Nov. 12, 2021, 5:06 p.m.