n_distinct: Efficiently count the number of unique values in a set of...

Description Usage Arguments Examples

View source: R/distinct.R

Description

This is a faster and more concise equivalent of length(unique(x))

Usage

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

Arguments

na.rm

id TRUE missing values don't count

...

vectors of values

Examples

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

sctyner/dplyr050 documentation built on May 17, 2019, 2:22 p.m.