View source: R/duplicate-tally.R
| duplicate_tally | R Documentation |
For every value in a vector or data frame, duplicate_tally()
counts how often it occurs in the whole input, and reports the count next
to the value.
Call audit() on the output for summary statistics.
duplicate_tally(x, ignore = NULL, colname_end = "n")
x |
Vector, matrix, or data frame. Blank strings, |
ignore |
Optionally, a vector of values not to check. Their tally is
|
colname_end |
String. Suffix of the tally columns. Default is |
Values with few characters are often duplicated by chance: in
iris, 99% of values have a duplicate. Duplicates are more meaningful when
there are fewer values and they have more characters.
Values are compared and returned as strings, so 1 and "1" are
duplicates, but 2 and "2.0" are not: 2.0 becomes "2".
A tibble with the columns of x (a value column if x is a
vector), each followed by its tally column.
It has the class scrutiny_dup_tally, which is recognized by audit().
audit()audit() on duplicate_tally() output
returns summary statistics for each tally column, with a .total row
across all of them. It finds these columns by the names that
duplicate_tally() gave them, so a renamed one is left out.
duplicate_count() for a frequency table.
duplicate_count_colpair() for duplicates between pairs of columns.
janitor::get_dupes() for duplicate rows.
duplicate_tally(x = pigs4)
duplicate_tally(x = pigs4$snout)
pigs4 |>
duplicate_tally() |>
audit()
pigs4 |>
duplicate_tally(ignore = c(8.13, 7.57))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.