absent_keys: Key combinations not present in input

View source: R/incomplete_keys.R

absent_keysR Documentation

Key combinations not present in input

Description

This function returns a dataframe of key column combinations that are not present in df. Thus if df has no key duplicates and nrow(absent_keys(df))==0 then df is complete in its keys.

Usage

absent_keys(df, key_cols = NULL, non_key_cols = NULL)

Arguments

df

Dataframe to inspect for incomplete key combinations.

key_cols

Character vector of key columns.

non_key_cols

Character vector of non-key columns. You cannot provide both key_cols and non_key_cols.

Details

By default if neither key_cols or non_key_cols are provided, all columns are interpreted as key columns.

Value

Dataframe.

Examples

> a <- tibble(key_1 = c(1,1,2),
              key_2 = c(1,2,1))

> absent_keys(a)
# A tibble: 1 × 2

seanob01PHS/list.utils documentation built on March 26, 2022, 12:41 p.m.