... columns of the df have a one-to-one relationR/summarize_data.R
are_paired.RdAim 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
are_paired(df, ...)logical
TODO: let's find a better name for this TODO: check better algorithms
are_paired(mtcars)
#> 32 combinations for all columns
#> number of unique values for each column as follows:
#> mpg cyl disp hp drat wt qsec vs am gear carb
#> 25 3 27 22 22 29 30 2 2 3 6
#> [1] FALSE
are_paired(mtcars, mpg, cyl)
#> 27 combinations for all columns
#> number of unique values for each column as follows:
#> mpg cyl
#> 25 3
#> [1] FALSE