R: Get rows of a 'data.frame' with identical values for the...

get_dupes {janitor} | R Documentation

## Get rows of a `data.frame` with identical values for the specified variables.

### Description

For hunting duplicate records during data cleaning. Specify the data.frame and the variable combination to search for duplicates and get back the duplicated rows.

### Usage

    get_dupes(dat, ...)

### Arguments

`dat` | the input data.frame.
`...` | unquoted variable names to search for duplicates.

### Value

Returns a data.frame (actually a `tbl_df`) with the full records where the specified variables have duplicated values, as well as a variable `dupe_count` showing the number of rows sharing that combination of duplicated values.

### Examples

    get_dupes(mtcars, mpg, hp)
    # or called with the magrittr pipe %>% :
    mtcars %>% get_dupes(wt)

[Package janitor version 1.0.0 Index]