Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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

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

Examples

# 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)

StatMeasures

Easy Data Manipulation, Data Quality and Statistical Checks

v1.0
GPL-2
Authors
Akash Jain
Initial release
2015-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.