Learn R Programming

optpart (version 3.0-3)

reordclust: Re-order Clusters in a Classification

Description

In it's simplest form simply reassigns cluster numbers in an existing classification to re-order tables and graphs. Can also be used to combine clusters into a fewer number of clusters.

Usage

reordclust(clustering,from,to)

Arguments

clustering

a vector of (interger) cluster mmeberships, or an object of class ‘clustering’, ‘partana’, or ‘partition’

from

an integer vector equal in length to the number of clusters that specifies the current clusters

to

an integer vector equal in length to the number of clusters that specifies the clusters the current clusters map to

Value

an object of class ‘clustering’

Details

The function simply maps cluster numbers in the ‘from’ vector to the respective cluster number in the ‘to’ vector.

References

http://ecology.msu.montana.edu/labdsv/R

See Also

mergeclust

Examples

Run this code
# NOT RUN {
data(shoshveg)
dis.bc <- dsvdis(shoshveg,'bray')
opt.10 <- optpart(10,dis.bc)
new <- reordclust(opt.10,1:10,c(1,3,5,7,9,2,4,6,8,10))
           # simply re-ordered
new2 <- reordclust(opt.10,1:10,c(1,1,2,2,3,3,4,4,5,5))
           # merge 1 and 2 into 1, 3 and 4 into 2, etc.
# }

Run the code above in your browser using DataLab