Learn R Programming

vectools (version 0.2.0)

40_unique-related_functions: Unique-Related Functions

Description

Convenience functions to test uniqueness, or to return the number of unique or duplication values, or a unique sorted vector.

The which.unique function returns a vector of indices. This will be produce a vector of unique values, if the original vector is subsetted using the indices.

Usage

is.each.equal (x)
is.each.unique (x)

n.unique (x) n.duplicated (x)

which.unique (x)

usv (x)

Arguments

x

An integer/numeric vector.

See Also

Sequence Properties

Optimization-Related Functions

Other Sequence Functions

Examples

Run this code
# NOT RUN {
x <- c (2, 2, 1, 1, 10, 12)

n.unique (x)
usv (x)
# }

Run the code above in your browser using DataLab