are_paired: Check if the '...' columns of the 'df' have a one-to-one...

View source: R/summarize_data.R

are_pairedR Documentation

Check if the ... columns of the df have a one-to-one relation

Description

Aim to test cases like:

  • A table with person_id and birth_date: each person_id must always have the same birth_date. Calling are_paired(df, person_id, birth_date) lets you test that. birth_date, of course, can be duplicated. Even person_id could also be duplicated.

  • data with region_name and region_code

Usage

are_paired(df, ...)

Arguments

df

a data.frame

...

unquoted columns of the df to test. If empty, all columns used

Details

TODO: let's find a better name for this TODO: check better algorithms

Value

logical

Examples

are_paired(mtcars)
are_paired(mtcars, mpg, cyl)

edalfon/efun documentation built on June 23, 2024, 4:17 a.m.