test_column_n_unique_values: Test unique values in a column

Description Usage Arguments Details Value Examples

View source: R/col-tests.R

Description

Performs a test that a specific column has an expected number of unique values.

Usage

1

Arguments

df

A dataframe

col

The unquoted column name of the column you want to test

n_expected

The expected number of unique values

Details

This function is good to utilize after performing joining operations to validate that no duplicates or missing values have been created. Note that this function does not count how many times each unique value appears - just the overall number of distinct items.

Value

The dataframe passed to the function.

Examples

1
2
# Basic usage
test_column_n_unique_values(mtcars, cyl, 3)

joshmuncke/easytest documentation built on Aug. 14, 2019, 3:07 p.m.