Learn R Programming

ensembleBMA (version 5.1.8)

dateCheck: Checks date format.

Description

Checks that the character form of a vector of dates conforms to YYYYMMDDHH or YYYYMMDD.

Usage

dateCheck(YYYYMMDDHH)

Value

A logical vector indicating whether or not each element of YYYYMMDDHH has the correct format.

Arguments

YYYYMMDDHH

A character vector (or its factor equivalent) of dates which should be in the form YYYYMMDDHH or YYYYMMDD, in which YYYY specifies the year, MM the month, DD the day, and (optionally) HH the hour.

Details

If both YYYYMMDDHH and YYYYMMDD are present, the YYYYMMDD dates are assumed to be in error even if HH == 00 for all of the longer dates.
Requires the chron library.

See Also

ymdhTOjul,julTOymdh

Examples

Run this code
   dateCheck(c("2008043000", "20080431", "20080501"))

Run the code above in your browser using DataLab