nDistinct: Number of Distinct Elements

Description

Count the number of distinct elements in a vector or a matrix.

Usage

1

Arguments

x

a vector or a matrix.

Value

A scalar giving te number of distinct elements in x.

Author(s)

Antoine Filipovic Pierucci

Examples

1
nDistinct(c(1, 3, 3, 5))

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.