| ExClust-class {apcluster} | R Documentation | 
Class "ExClust"
Description
S4 class for storing exemplar-based clusterings
Objects
Objects of this class can be created by calling cutree
to cut out a clustering level from a cluster hierarchy
of class AggExResult. Moreover,
cutree can also be used to convert an object of
class APResult to class ExClust.
Slots
The following slots are defined for ExClust objects:
- l:
- number of samples in the data set 
- sel:
- subset of samples used for leveraged clustering 
- exemplars:
- vector containing indices of exemplars 
- clusters:
- list containing the clusters; the i-th component is a vector of indices of data points belonging to the i-th exemplar (including the exemplar itself) 
- idx:
- vector of length - lrealizing a sample-to-exemplar mapping; the i-th entry contains the index of the exemplar the i-th sample belongs to
- sim:
- similarity matrix; only available if the preceding clustering method was called with - includeSim=TRUE.
- call:
- method call of the preceding clustering method 
Methods
- plot
- signature(x="ExClust"): see- plot-methods
- plot
- signature(x="ExClust", y="matrix"): see- plot-methods
- heatmap
- signature(x="ExClust"): see- heatmap-methods
- heatmap
- signature(x="ExClust", y="matrix"): see- heatmap-methods
- show
- signature(object="ExClust"): see- show-methods
- labels
- signature(object="ExClust"): see- labels-methods
- cutree
- signature(object="ExClust", k="ANY", h="ANY"): see- cutree-methods
- length
- signature(x="ExClust"): gives the number of clusters.
- sort
- signature(x="ExClust"): see- sort-methods
- as.hclust
- signature(x="ExClust"): see- coerce-methods
- as.dendrogram
- signature(object="ExClust"): see- coerce-methods
Accessors
In the following code snippets, x is an ExClust object.
- [[
- signature(x="ExClust", i="index", j="missing"):- x[[i]]returns the i-th cluster as a list of indices of samples belonging to the i-th cluster.
- [
- signature(x="ExClust", i="index", j="missing", drop="missing"):- x[i]returns a list of integer vectors with the indices of samples belonging to this cluster. The list has as many components as the argument- ihas elements. A list is returned even if- iis a single integer.
- similarity
- signature(x="ExClust"): gives the similarity matrix.
Author(s)
Ulrich Bodenhofer, Andreas Kothmeier, and Johannes Palme
References
https://github.com/UBod/apcluster
Bodenhofer, U., Kothmeier, A., and Hochreiter, S. (2011) APCluster: an R package for affinity propagation clustering. Bioinformatics 27, 2463-2464. DOI: doi:10.1093/bioinformatics/btr406.
See Also
aggExCluster, show-methods,
plot-methods, labels-methods,
cutree-methods, AggExResult,
APResult
Examples
## create two Gaussian clouds
cl1 <- cbind(rnorm(20, 0.2, 0.05), rnorm(20, 0.8, 0.06))
cl2 <- cbind(rnorm(25, 0.7, 0.08), rnorm(25, 0.3, 0.05))
x <- rbind(cl1, cl2)
## compute similarity matrix (negative squared Euclidean)
sim <- negDistMat(x, r=2)
## run affinity propagation
aggres <- aggExCluster(sim)
## extract level with two clusters
excl <- cutree(aggres, k=2)
## show details of clustering results
show(excl)
## plot information about clustering run
plot(excl, x)