n_distinct.: Count the number of unique values in a vector

Description Usage Arguments Examples

View source: R/n_distinct.R

Description

This is a faster version of length(unique(x)) that calls data.table::uniqueN().

Usage

1
n_distinct.(..., na.rm = FALSE)

Arguments

...

vectors of values

na.rm

If TRUE missing values don't count

Examples

1
2
x <- sample(1:10, 1e5, rep = TRUE)
n_distinct.(x)

mtfairbanks/gdt documentation built on May 4, 2021, 9:44 a.m.