lunique {lvmisc}R Documentation

Number of elements in a vector.

Description

lunique returns the number of non-NA unique elements and lna returns the number of NAs.

Usage

lunique(x)

lna(x)

Arguments

x

A vector.

Value

A non-negative integer.

See Also

length(), unique(), is.na()

Examples

x <- sample(c(1:3, NA), 10, replace = TRUE)
lunique(x)
lna(x)

[Package lvmisc version 0.1.2 Index]