Learn R Programming

ChemoSpec (version 3.0-1)

evalClusters: Evaluate or Compare the Quality of Clusters Quantitatively

Description

This function is a wrapper to the the intCriteria function in package clusterCrit. It can be used to quantitatively compare two different clustering strategies.

Usage

evalClusters(spectra, hclst, k = NULL, h = NULL, crit = "Dunn")

Arguments

spectra
An object of S3 class "Spectra".
hclst
An object of S3 class "hclust".
k
Integer. The number of groups in which to cut the tree (hclust).
h
Numeric. The height at which to cut the tree. Either k or h must be given, with k taking precedence. See cutree.
crit
String. A string giving the criteria to be used in evaluating the quality of the cluster. See intCriteria.

Value

  • A list giving the results, as described in intCriteria.

References

https://github.com/bryanhanson/ChemoSpec

See Also

hclust hcaSpectra for HCA analysis of a "Spectra" object. hcaScores for HCA analysis of PCA scores from a "Spectra" object. plotHCA

Examples

Run this code
data(SrE.IR)
res1 <- hcaSpectra(SrE.IR, main = myt) # default clustering and distance methods
res2 <- hcaSpectra(SrE.IR, main = myt, c.method = "median", d.method = "manhattan")
# The return value from hcaSpectra is a list with hclust as the first element.
crit1 <- evalClusters(SrE.IR, res1[[1]], k = 4)
crit2 <- evalClusters(SrE.IR, res2[[1]], k = 4)
# res1 gave a better clustering

Run the code above in your browser using DataLab