flag_dupes: Flag Duplicate Rows With New Column

View source: R/flag-dupes.R

flag_dupesR Documentation

Flag Duplicate Rows With New Column

Description

This function uses dplyr::mutate() to create a new dupe_flag logical variable with TRUE values for any record duplicated more than once.

Usage

flag_dupes(data, ..., .check = TRUE, .both = TRUE)

Arguments

data

A data frame to flag.

...

Arguments passed to dplyr::select() (needs to be at least dplyr::everything()).

.check

Whether the resulting column should be summed and removed if empty.

.both

Whether to flag both duplicates or just subsequent.

Value

A data frame with a new dupe_flag logical variable.

Examples

flag_dupes(iris, dplyr::everything())
flag_dupes(iris, dplyr::everything(), .both = FALSE)

campfin documentation built on Oct. 20, 2023, 5:06 p.m.