Last updated: August 19, 2020

# Show duplicates
df %>%

# Show both the original and duplicate rows
dupes <- df %>%
df %>%
  filter(column_name %in% dupes$column_name) %>%

# Delete duplicates
df <- df %>% distinct(column_name, .keep_all = TRUE)

ℹī¸ This page is part of my knowledge base for R, the popular statistical programming language. I attempt to use idiomatic practices with the tidyverse collection of packages as much as possible. If you have suggestions for ways to improve this code, please contact me or use the survey link below..