Learn R Programming

testdat (version 0.2)

test_datecol: Test for proper formatting in a date column

Description

Test for proper formatting in a date column

Usage

test_datecol(dat, index, form = ymd)

Arguments

dat
data frame to test
index
index of column containing dates
form
a lubridate function giving the format the dates should be in

Value

returns FALSE if parsing using the function specified in form fails. If parsing succeeds, the minimum and maximum years in the date column are printed, so that mis-formatted dates (that still pass parse tests) can be detected.