Learn R Programming

drclust (version 0.1.1)

cluster: classification variable

Description

Recodes the binary and row-stochastic membership matrix U into the classification variable (similar to the "cluster" output returned by kmeans()).

Usage

cluster(U)

Value

cl

vector of length n indicating, for each element, the index of the cluster to which it has been assigned.

Arguments

U

Binary and row-stochastic matrix.

Author

Ionel Prunila, Maurizio Vichi

Examples

Run this code
# Iris data 
# Loading the numeric variables of iris data
iris <- as.matrix(iris[,-5]) 

# standardizing the data
iris <- scale(iris)

# double k-means with 3 unit-clusters and 2 components for the variables
p1 <- redkm(iris, K = 3, Q = 2)
cl <- cluster(p1$U)

Run the code above in your browser using DataLab