Learn R Programming

apcluster (version 1.0.2)

apcluster-package: Affinity Propagation Package

Description

The apcluster package implements affinity propagation according to Frey and Dueck. It further offers visualization of the algorithm's progress and clustering results (limited to 2D data sets).

Arguments

Details

ll{ Package: apcluster Type: Package Version: 1.0.2 Date: 2010-03-19 License: GPL (>= 2) LazyLoad: yes } The central function is apcluster. It runs affinity propagation on a given similarity matrix. The function returns an APResult object from which the clustering itself and information about the affinity propagation run can be obtained. Further functions are implemented to visualize the results and to create distance matrices.

References

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

Frey, B. J. and Dueck, D. (2007) Clustering by passing messages between data points. Science 315, 972-976.

Examples

Run this code
## 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, details=TRUE)

## show details of clustering results
show(apres)

## plot information about clustering run
plot(apres)

## plot clustering result
plot(apres, x)

Run the code above in your browser using DataLab