Learn R Programming

multiplyr (version 0.1.1)

n_distinct: Return the number of unique values

Description

Return the number of unique values

Usage

n_distinct(x)

Arguments

x
Vector

Value

Number of unique values of x

See Also

Other utility functions: between, cumall, cumany, cummean, distribute, first, lag, last, lead, n_groups, nth, n

Examples

Run this code
n_distinct (c(1, 2, 3, 3, 3, 4, 5))

Run the code above in your browser using DataLab