test_no_duplicates: Test that there are no duplicates in a dataframe

Description Usage Arguments Details Value Examples

View source: R/df-tests.R

Description

Performs a test that a dataframe has no duplicate rows. Column names can be passed in (like select) if you wish to restrict the duplicate search to just these columns.

Usage

1

Arguments

df

A dataframe

...

Optional selection of specific columns to include in the duplicate check.

Details

When selecting a subset of columns be aware that duplicates will still be looked for within the entire row - not for each column individually.

Value

The dataframe passed to the function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Basic usage - passes
test_no_duplicates(mtcars)

# Select specific columns - fails
## Not run: 
test_no_duplicates(mtcars, cyl)

## End(Not run)

# Can also be used in magrittr pipe
library(dplyr)
mtcars %>% test_no_duplicates() %>% select(mpg)

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