which.format: Utilities for detecting the format of date strings

Description Usage Arguments Value Note See Also Examples

Description

Utilities for detecting the format of date strings

which.format

.which.format

Usage

1
2
3
which.format(x, nTrials = 1, nErrors = 0)

.which.format(txt)

Arguments

x

character; values to convert to a POSIX date

nTrials

integer; number of strings to check before deciding the format

nErrors

integer; the number of unparsable strings to allow. If the number of unparseable strings exceeds nErrors, return NA, which means that the strings are either not dates, or not a consistent format.

txt

character; value to convert to a POSIXct date

Value

character, name for the date format

character representing the name of the date format

Note

Internal function that is not exported

See Also

as.POSIXct

as.POSIXct

Examples

1
2
3
4
5
6
7
x <- c("January 11, 2014", "February 15, 1958", "2015/03/23")
  which.format(x, nTrials=3, nErrors=1)
## Not run: 
   .which.format("January 11, 2014")
   .which.format("2014/02/16")
 
## End(Not run)

decisionpatterns/date.reader documentation built on May 15, 2019, 1:55 a.m.