isDate: Test if a vector can be a class Date

View source: R/isDate.r

isDateR Documentation

Test if a vector can be a class Date

Description

Test if a vector can be a class Date

Usage

isDate(x, date.format)

Arguments

x

a vector

date.format

a character string as in as.Date

Value

vector

Author(s)

JuG

Examples

dates <- c("02/27/92", NA, "01/14/92", "02/28/92", "02/01/92")
isDate(dates, date.format= "%m/%d/%y")

data <- data.frame( Date=c("10/11/2012","10/12/2012", "25/12/2012"),
                    AE=c(1211,100,23),
                    Percent=c(0.03,0.43,"a"),
                    Date2=c("10/27/2012","10/12/12","12/25/12" ))
sapply(data,isDate)
sapply(data,isDate, date.format= "%m/%d/%y")

jgodet/utilitR documentation built on May 16, 2024, 12:01 p.m.