get_duplicates_dataset {admiral}R Documentation

Get Duplicate Records that Lead to a Prior Error

Description

Get Duplicate Records that Lead to a Prior Error

Usage

get_duplicates_dataset()

Details

Many admiral function check that the input dataset contains only one record per by_vars group and throw an error otherwise. The get_duplicates_dataset() function allows one to retrieve the duplicate records that lead to an error.

Note that the function always returns the dataset of duplicates from the last error that has been thrown in the current R session. Thus, after restarting the R sessions get_duplicates_dataset() will return NULL and after a second error has been thrown, the dataset of the first error can no longer be accessed (unless it has been saved in a variable).

Value

A data.frame or NULL

Author(s)

Thomas Neitmann

See Also

Utilities for Dataset Checking: extract_duplicate_records(), get_many_to_one_dataset(), get_one_to_many_dataset()

Examples

data(admiral_adsl)

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

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

get_duplicates_dataset()

[Package admiral version 0.8.4 Index]