Check a set of columns in a data frame uniquely identify data frame rows.
Source:R/checkers.R
assert_cols_det_unique_row.Rd
Equivalently, this checks that when grouping by the columns in question, each group has a single entry
Usage
assert_cols_det_unique_row(
df,
unique_key_columns,
arg = "x",
call = rlang::caller_env(),
add_err_msg = ""
)
Arguments
- df
the dataframe to check
- unique_key_columns
Columns that, taken together, should uniquely identify a row in the data frame.
- arg
the name of the unique grouping to check
- call
Calling environment to be passed to
cli::cli_abort()
for traceback.- add_err_msg
string containing an additional error message, default is the empty string (
""
)