Learn R Programming

StatMeasures (version 1.0)

contents: Basic summary of the data

Description

Takes in a data and returns summary of the data

Usage

contents(data)

Arguments

data
a data.frame or data.table

Value

a data.frame that contains variable, class, distinct values, missing values, percentage of missing value and sample value

Details

This function helps when one wants to get a quick snapshot of the data such as class, distinct values, missing values and sample value of the variables.

It works for both 'data.frame' and 'data.table' but the output will be a 'data.frame' only.

See Also

dqcontinuous, dqcategorical, dqdate

Examples

Run this code
# A data frame
df <- data.frame(x = c(1, 2, 3, 4, NA),
                 y = c('a', 'b', 'c', 'd', 'e'),
                 z = c(1, 1, 0, 0, 1))

# Summary of the data
dfContents <- contents(data = df)

Run the code above in your browser using DataLab