signal_duplicate_records: Signal Duplicate Records

View source: R/duplicates.R

signal_duplicate_recordsR Documentation

Signal Duplicate Records

Description

Signal Duplicate Records

Usage

signal_duplicate_records(
  dataset,
  by_vars,
  msg = paste("Dataset contains duplicate records", "with respect to",
    "{.var {replace_values_by_names(by_vars)}}"),
  cnd_type = "error"
)

Arguments

dataset

Input dataset

The variables specified by the by_vars argument are expected to be in the dataset.

by_vars

Grouping variables

Defines groups of records in which to look for duplicates.

Permitted Values: list of variables created by exprs() e.g. exprs(USUBJID, VISIT)

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

See Also

Other internal: admiral-package, extract_duplicate_records(), format.basket_select()

Examples

data(admiral_adsl)

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

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

admiral documentation built on June 22, 2024, 9:06 a.m.