Learn R Programming

actuaRE (version 0.1.7)

NrUnique: Number of unique elements in a vector

Description

Number of unique elements in a vector

Usage

NrUnique(x, na.rm = TRUE)

Value

vector with the number of unique elements

Arguments

x

object of type vector.

na.rm

logical indicating if missing values have to be removed. Default to TRUE.

Examples

Run this code
set.seed(1)
x = sample(letters, 50, TRUE)
NrUnique(x)

Run the code above in your browser using DataLab