signal_duplicate_records {admiral}R Documentation

Signal Duplicate Records

Description

Signal Duplicate Records

Usage

signal_duplicate_records(
  dataset,
  by_vars,
  msg = paste("Dataset contains duplicate records with respect to",
    enumerate(vars2chr(by_vars))),
  cnd_type = "error"
)

Arguments

dataset

A data frame

by_vars

A list of variables created using vars() identifying groups of records in which to look for duplicates

msg

The condition message

cnd_type

Type of condition to signal when detecting duplicate records. One of "message", "warning" or "error". Default is "error".

Value

No return value, called for side effects

Author(s)

Thomas Neitmann

See Also

Utilities used within Derivation functions: call_user_fun(), extract_unit(), get_not_mapped()

Examples

data(admiral_adsl)

# Duplicate the first record
adsl <- rbind(admiral_adsl[1L, ], admiral_adsl)

signal_duplicate_records(adsl, vars(USUBJID), cnd_type = "message")

[Package admiral version 0.8.4 Index]