ez.is.date: check if a vector is already stored as a date type

View source: R/basic.R

ez.is.dateR Documentation

check if a vector is already stored as a date type

Description

check if a vector is already stored as a date type

Usage

ez.is.date(x)

Arguments

x

a vector, no need to specify date formats

Value

returns a single T/F (not vectorized). If x is a date, is.numeric(x) is FALSE.

See Also

ez.date ez.is.date ez.is.date.like ez.age ez.time

Examples

mydate = c("10/11/2012","10/12/2012")
# format one of c("%d/%m/%Y", "%d-%m-%Y", "%Y/%m/%d", "%m/%d/%Y", "%Y-%m-%d"). %y for two year digits
mydate = as.Date(mydate,format = "%m/%d/%Y")  # "2012-10-11" "2012-10-12"
ez.is.date(mydate)  # T

jerryzhujian9/ezmisc documentation built on March 9, 2024, 12:44 a.m.