Learn R Programming

isopam (version 3.2)

clusters: Returns clusters of an Isopam clustering

Description

Provides a vector or data frame with cluster affiliations determined using Isopam.

Usage

clusters(x, level = NULL, k = NULL, style = c("flat", "hierarchical"))

Value

Factor vector or data frame with the cluster assignments.

Arguments

x

Object of class isopam.

level

An integer scalar or vector with the desired cluster level(s). Level numbers start with 1 for the first division.

k

An integer scalar or vector with the desired number(s) of groups

style

Whether the labels of the clusters are consecutive ('flat') or nested ('hierarchical', i.e. 1.1, 1.2 etc.).

Author

Sebastian Schmidtlein

See Also

isopam, isotab

Examples

Run this code
   ## load data to the current environment
   data(andechs)
     
   ## call isopam with the standard options
   ip <-isopam(andechs)
    
   ## return clusters
   clusters(ip)

   ## clusters of level 2, with labels reflecting the hierarchy
   clusters(ip, 2, style = "hierarchical")

   ## cluster solution with 3 classes
   clusters(ip, k = 3)

Run the code above in your browser using DataLab