findClusters: Detect clusters in a densityCluster obejct

Description Usage Arguments Value References Examples

View source: R/densityClust.R

Description

This function uses the supplied rho and delta thresholds to detect cluster peaks and assign the rest of the observations to one of these clusters. Furthermore core/halo status is calculated. If either rho or delta threshold is missing the user is presented with a decision plot where they are able to click on the plot area to set the treshold. If either rho or delta is set, this takes presedence over the value found by clicking.

Usage

1
2
3
4
5
findClusters(x, ...)

## S3 method for class 'densityCluster'
findClusters(x, rho, delta, plot = FALSE,
  peaks = NULL, verbose = FALSE, ...)

Arguments

x

A densityCluster object as produced by densityClust()

...

Additional parameters passed on

rho

The threshold for local density when detecting cluster peaks

delta

The threshold for minimum distance to higher density when detecting cluster peaks

plot

Logical. Should a decision plot be shown after cluster detection

peaks

A numeric vector indicates the index of density peaks used for clustering. This vector should be retrieved from the decision plot with caution. No checking involved.

verbose

Logical. Should the running details be reported

Value

A densityCluster object with clusters assigned to all observations

References

Rodriguez, A., & Laio, A. (2014). Clustering by fast search and find of density peaks. Science, 344(6191), 1492-1496. doi:10.1126/science.1242072

Examples

1
2
3
4
5
6
7
irisDist <- dist(iris[,1:4])
irisClust <- densityClust(irisDist, gaussian=TRUE)
plot(irisClust) # Inspect clustering attributes to define thresholds

irisClust <- findClusters(irisClust, rho=2, delta=2)
plotMDS(irisClust)
split(iris[,5], irisClust$clusters)

densityClust documentation built on May 2, 2019, 6:59 a.m.