Learn R Programming

apcluster (version 1.4.7)

show-methods: Display Clustering Result Objects

Description

Display methods for S4 classes '>APResult, '>ExClust, and '>AggExResult

Usage

# S4 method for APResult
show(object)
# S4 method for ExClust
show(object)
# S4 method for AggExResult
show(object)

Arguments

object

an object of class '>APResult, '>ExClust, or '>AggExResult

Value

show returns an invisible NULL

Details

show displays the most important information stored in object.

For '>APResult objects, the number of data samples, the number of clusters, the number of iterations, the input preference, the final objective function values, the vector of exemplars, the list of clusters and for leveraged clustering the selected sample subset are printed.

For '>ExClust objects, the number of data samples, the number of clusters, the vector of exemplars, and list of clusters are printed.

For '>AggExResult objects, only the number of data samples and the maximum number of clusters are printed. For retrieving a particular clustering level, use the function cutree.

For accessing more detailed information, it is necessary to access the slots of object directly. Use str to get a compact overview of all slots of an object.

References

http://www.bioinf.jku.at/software/apcluster

Bodenhofer, U., Kothmeier, A., and Hochreiter, S. (2011) APCluster: an R package for affinity propagation clustering. Bioinformatics 27, 2463-2464. DOI: 10.1093/bioinformatics/btr406.

See Also

'>APResult, '>ExClust, '>AggExResult, cutree-methods

Examples

Run this code
# NOT RUN {
## create two Gaussian clouds
cl1 <- cbind(rnorm(100, 0.2, 0.05), rnorm(100, 0.8, 0.06))
cl2 <- cbind(rnorm(50, 0.7, 0.08), rnorm(50, 0.3, 0.05))
x <- rbind(cl1, cl2)

## compute similarity matrix (negative squared Euclidean)
sim <- negDistMat(x, r=2)

## run affinity propagation
apres <- apcluster(sim)

## show details of clustering results
show(apres)

## apply agglomerative clustering to apres
aggres <- aggExCluster(sim, apres)

## display overview of result
show(aggres)

## show clustering level with two clusters
show(cutree(aggres, 2))
# }

Run the code above in your browser using DataLab