View source: R/epi_clean_get_dups.R
epi_clean_get_dups | R Documentation |
base R duplicated() does not return the originals (duplicated - 1). See for example find duplicates in R.
epi_clean_get_dups(df = NULL, var = "", freq = 1)
df |
A data.frame to extract duplicates from |
var |
Variable/column name as a string to use to detect duplicate values |
freq |
Frequency count, an integer. Defaults to 1 (so will return original plus any repeating values) |
a data.frame with original and duplicated rows
Creates a table with frequencies, checks those which have more than 1 (or value passed to freq and considers these as variables with duplicates) and extracts them.
Antonio Berlanga-Taylor <\url{https://github.com/AntonioJBT/episcout}>
duplicated
## Not run:
dim(df)
epi_head_and_tail(df, rows = 2, cols = 2)
# Get all duplicates:
check_dups <- epi_clean_get_dups(df, 'var_id', 1)
dim(check_dups)
check_dups
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.