data_frame_uniqueness: Check uniqueness of column combinations

data_frame_uniqueness_testR Documentation

Check uniqueness of column combinations

Description

Useful checking that duplicates of primary keys don't exist

Usage

data_frame_uniqueness_test(d, keys, display_count = 10L)

data_frame_uniqueness_assert(d, keys, display_count = 10L)

Arguments

d

A data.frame to examine. Required.

keys

A character vector specifying the (combination of) columns that should be unique.

display_count

Maximum number of uniqueness violations to display.

Value

A logical value indicating if uniqueness is satisfied. If FALSE, the top rows are printed to the console.

Author(s)

Will Beasley

Examples

data_frame_uniqueness_test(mtcars, c("cyl"))
data_frame_uniqueness_test(mtcars, c("cyl", "vs"))
data_frame_uniqueness_test(mtcars, c("cyl", "hp"))
data_frame_uniqueness_test(mtcars, c("cyl", "hp"), display_count=0)
data_frame_uniqueness_test(mtcars, c("mpg", "wt"))

## Not run: 
data_frame_uniqueness_assert(mtcars, c("cyl"))
data_frame_uniqueness_assert(mtcars, c("cyl", "vs"))
data_frame_uniqueness_assert(mtcars, c("mpg", "wt"))

## End(Not run)


OuhscBbmc/OuhscMunge documentation built on Dec. 5, 2024, 4:34 a.m.