Learn R Programming

StatMeasures (version 1.0)

dqdate: Data quality check of date variables

Description

Takes in a data, and returns summary of date variables

Usage

dqdate(data)

Arguments

data
a data.frame or data.table

Value

a data.frame which contains the variable, non-missing values, missing values, minimum and maximum of all date variables

Details

dqdate produces summary of all date variables in the data. The function identifies all variables as date if they are of class 'Date' or 'IDate'.

Generally the dates are imported in R as character. They must be converted to an appropriate date format and then the function should be used.

The summary includes variable, non-missing values, missing values, minimum and maximum of the date variabes. Input data can be a 'data.frame' or 'data.table' but the output summary will be a 'data.frame' only.

See Also

dqcontinuous, dqcategorical, contents

Examples

Run this code
# A 'data.frame'
df <- data.frame(date = c('2012-11-21', '2015-1-4', '1996-4-30', '1979-9-23', '2005-5-13'),
                 temperature = c(26, 32, 35, 7, 14))

# Convert character date to date format
df[, 'date'] <- as.Date(df[, 'date'])

# Generate a data quality report of date variables
summaryDate <- dqdate(data = df)

Run the code above in your browser using DataLab