Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

groups

Extracts groups


Description

Extracts the detected groups from objects of pdfCluster-class.

Usage

groups(obj, stage = length(obj@stages))

Arguments

obj

An object of pdfCluster-class

stage

The stage of classification at which the clusters have to be extracted. Set this value to 0 to extract the cluster cores. Default value is the total number of classification stages, that is, the final partition is given. When obj contains the clusters cores only, these are given by default.

Details

This function is an user-friendly version of command obj@clusters, now obsolete, to ease extraction of groups from objects of pdfCluster-class.

Value

A numeric vector containing the group labels. NA values are associated to points not classified at the selected stage of the classification procedure.

See Also

Examples

# load data
data(wine)

# select a subset of variables
x <- wine[, c(2, 5, 8)]

#clustering
cl <- pdfCluster(x)

groups(cl)

#equivalent to:
cl@clusters

#to extract the cluster cores
groups(cl, stage = 0)

pdfCluster

Cluster Analysis via Nonparametric Density Estimation

v1.0-3
GPL-2
Authors
Adelchi Azzalini, Giovanna Menardi for the current version; Adelchi Azzalini, Giovanna Menardi and Tiziana Rosolin up to version 0.1-13.
Initial release
2018-12-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.