find_dupes: Identify duplicate cases

View source: R/find_dupes.R

find_dupesR Documentation

Identify duplicate cases

Description

Identify duplicate cases in a data frame or tibble based on specific variables. A logical column 'has_dupes' is added, that indicates whether or not a row has duplicate values based on the provided variables.

Usage

find_dupes(data, ...)

Arguments

data

A data frame or tibble

...

Variable names to check for duplicates

Value

The original data frame or tibble with an additional logical column 'has_dupes' which is 'TRUE' for rows that have duplicates based on the specified variables and 'FALSE' otherwise.

Examples

# Example data
print(sailor_students)

# Find duplicate cases based on 'sgic', 'school' and 'class'
sailor_students_dupes <- find_dupes(sailor_students, sgic, school, class)

# Rows where 'has_dupes' is `TRUE` indicate duplicates based on the provided columns
print(sailor_students_dupes)

trustmebro documentation built on June 8, 2025, 11:01 a.m.