Description Usage Arguments Details Value Author(s) Examples
Returns the number of unique elements. Reports if there are possible double-ups and what they might be.
1 | length_unique(x, verbose=TRUE)
|
x |
A vector to test for uniqueness. |
verbose |
A logical. Should a formal warning() be thrown. |
Counts the number of unique values in x
. If the number of unique items does not equal the overall number of items then a double-up is suspected. If verbose=TRUE
then a formal warning is thrown, otherwise it is up to the user to test pos_double
manually.
A named list containing:
lenuni |
The number of unique items in |
pos_double |
A logical denoting if double-ups were detected. |
pos_double_names |
If |
Daniel Pritchard and Gretchen Brownstein
1 2 3 4 5 | dat <- c('Apples', 'Oranges', 'Cheese')
length_unique(dat)
dat_nonunique <- c('Apples', 'Oranges', 'Cheese', 'Apples')
length_unique(dat_nonunique)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.