Description Usage Arguments Value Examples
fraction of unique values in a vector
1 | unique_fraction(vec, na.rm = TRUE)
|
vec |
A vector |
na.rm |
Whether to consider NAs as a distinct element |
A numeric between 0 and 1
1 2 3 | unique_fraction(c(1, 1, 2, 2, 2))
unique_fraction(c(1, 1, 2, 2, NA, 2, NA))
unique_fraction(c(1, 1, 2, 2, NA, 2, NA), na.rm = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.