Given a vector of atomic type (logical
, integer
,
numeric
, complex
, character
) or a factor the function
returns the number of different elements.
nunique(x)
Arguments
x |
[atomic | factor ]
A vector. |
Value
A single integer value.
Note
NAs are counted as a seperate value.
Examples
#> [1] 5