Learn R Programming

admiral (version 1.3.0)

extract_duplicate_records: Extract Duplicate Records

Description

Extract Duplicate Records

Usage

extract_duplicate_records(dataset, by_vars = NULL)

Value

A data.frame of duplicate records within dataset

Arguments

dataset

Input dataset

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

Default value

none

by_vars

Grouping variables

Defines groups of records in which to look for duplicates. If omitted, all variables in the input dataset are used in the by group.

Note: Omitting by_vars will increase the function's run-time, so it is recommended to specify the necessary grouping variables for large datasets whenever possible.

Permitted values

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

Default value

NULL

See Also

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

Examples

Run this code
data(admiral_adsl)

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

extract_duplicate_records(adsl, exprs(USUBJID))

Run the code above in your browser using DataLab