Skip to contents

Counts unique values

Usage

lengthu(x)

Arguments

x

a vector

Value

A numeric scalar giving the number of distinct values in x.

Examples

x <- c(5, 7, 8, 9, 5, 7)
length(x)
#> [1] 6
lengthu(x)
#> [1] 4