View source: R/distinct_values.R
distinct_values | R Documentation |
Extracts the distinct values of an atomic vector, with the possibility to drop levels and remove missing values.
distinct_values(x, drop = TRUE, na_rm = TRUE)
x |
(atomic |
drop |
:: |
na_rm |
:: |
(atomic vector()
) with distinct values in no particular order.
# for factors:
x = factor(c(letters[1:2], NA), levels = letters[1:3])
distinct_values(x)
distinct_values(x, na_rm = FALSE)
distinct_values(x, drop = FALSE)
distinct_values(x, drop = FALSE, na_rm = FALSE)
# for logicals:
distinct_values(TRUE, drop = FALSE)
# for numerics:
distinct_values(sample(1:3, 10, replace = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.