dqdate: Data quality check of date variables

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/dqdate.R

Description

Takes in a data, and returns summary of date variables

Usage

1

Arguments

data

a data.frame or data.table

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.

Value

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

Author(s)

Akash Jain

See Also

dqcontinuous, dqcategorical, contents

Examples

1
2
3
4
5
6
7
8
9
# 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)

Example output



StatMeasures documentation built on May 2, 2019, 1:44 p.m.