Skip to contents

A short hand for unique() %>% length()

Usage

len_uniq(vec)

Arguments

vec

A vector with a various objects

Value

The number of unique objects in the vector

Examples

vec <- sample(1:10, size = 20, replace=TRUE)

vec
#>  [1] 7 5 6 4 6 9 5 5 8 2 7 5 5 2 6 4 2 3 9 6

sort_uniq(vec)
#> [1] 2 3 4 5 6 7 8 9