ordered.clusters: Check if unique elements of a vector appear in contiguous...

View source: R/ordered.clusters.R

ordered.clustersR Documentation

Check if unique elements of a vector appear in contiguous clusters

Description

ordered.clusters determines if identical elements of a vector appear in contiguous clusters, and returns TRUE if the do and FALSE otherwise.

Usage

ordered.clusters(id)

Arguments

id

a vector

Value

The function returns TRUE if the elements appear in contiguous clusters and FALSE otherwise

Author(s)

Claus Ekstrom claus@ekstroem.dk with suggestions from Peter Dalgaard.

See Also

duplicated

Examples


x <- c(1, 1, 1, 2, 2, 3, 4, 1, 5, 5, 5)
ordered.clusters(x)
ordered.clusters(sort(x))
ordered.clusters(x[order(x)])


ekstroem/MESS documentation built on July 28, 2023, 4:02 a.m.