View source: R/deduplicate_by.R
| deduplicate_by | R Documentation |
This function removes duplicate rows from a data frame while keeping the first occurrence of each unique combination of the specified grouping variables.
deduplicate_by(.data, ...)
.data |
A data frame or tibble |
... |
One or more unquoted variable names to group by |
A data frame with duplicate rows removed, keeping only the first occurrence for each unique combination of grouping variables
# Remove duplicates based on a single column
mtcars %>% deduplicate_by(carb)
# Remove duplicates based on multiple columns
mtcars %>% deduplicate_by(carb, mpg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.