Learn R Programming

trustmebro (version 1.0.0)

find_dupes: 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, ...)

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.

Arguments

data

A data frame or tibble

...

Variable names to check for duplicates

Examples

Run this code
# 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)

Run the code above in your browser using DataLab