is_id: Do the claimed variables identify rows?

Description Usage Arguments Value Examples

View source: R/uniqueness.r

Description

Just like Stata's isid. For normal tables, this runs faster if data.table is installed.

Usage

1
is_id(df, ..., notifier = base::warning)

Arguments

df

A dataframe to test

...

Variable names, following dplyr::select rules

notifier

A function to report conditions you wouldn't want in an ID variable (Defaults to base::warning. Other reasonable options might be base::stop to escalate issues or base::force to not report them.)

Value

TRUE/FALSE for ID-ness

Examples

1
2
3
4
5
is_id(mtcars, cyl)  # FALSE
is_id(Loblolly, Seed) # FALSE
is_id(Loblolly, Seed, age) # TRUE
vars <- c("Seed", "age")
is_id(Loblolly, vars) # TRUE

karldw/kdw.junk documentation built on Sept. 8, 2021, 9:30 p.m.