find_dupes {trustmebro}R 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)

[Package trustmebro version 1.0.0 Index]