graph.cluster: Hierarchical cluster analysis on a list of graphs.

Description Usage Arguments Value References Examples

View source: R/statGraph.R

Description

Given a list of graphs, 'graph.cluster' builds a hierarchy of clusters according to the Jensen-Shannon divergence between graphs.

Usage

1
graph.cluster(x, k, method = "complete", bandwidth = "Silverman")

Arguments

x

a list of adjacency matrices. For unweighted graphs, each matrix contains only 0s and 1s. For weighted graphs, each matrix may contain nonnegative real values that correspond to the weights of the edges.

k

the number of clusters.

method

the agglomeration method to be used. This should be (an unambiguous abbreviation of) one of <e2><80><98>"ward.D"<e2><80><99>, <e2><80><98>"ward.D2"<e2><80><99>, <e2><80><98>"single"<e2><80><99>, <e2><80><98>"complete"<e2><80><99>, <e2><80><98>"average"<e2><80><99> (= UPGMA), <e2><80><98>"mcquitty"<e2><80><99> (= WPGMA), <e2><80><98>"median"<e2><80><99> (= WPGMC) or <e2><80><98>"centroid"<e2><80><99> (= UPGMC).

bandwidth

string indicating which criterion will be used to choose the bandwidth for the spectral density estimation. The available criteria are "Silverman" (default) and "Sturges".

Value

A list containing:

hclust

an object of class *hclust* which describes the tree produced by the clustering process.

cluster

the clustering labels for each graph.

References

Takahashi, D. Y., Sato, J. R., Ferreira, C. E. and Fujita A. (2012) Discriminating Different Classes of Biological Networks by Analyzing the Graph Spectra Distribution. _PLoS ONE_, *7*, e49949. doi:10.1371/journal.pone.0049949.

Silverman, B. W. (1986) _Density Estimation_. London: Chapman and Hall.

Sturges, H. A. The Choice of a Class Interval. _J. Am. Statist. Assoc._, *21*, 65-66.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
require(igraph)
g <- list()
for (i in 1:5) {
    g[[i]] <- as.matrix(get.adjacency(
                        erdos.renyi.game(50, 0.5, type="gnp",
                                         directed = FALSE)))
}
for (i in 6:10) {
    g[[i]] <- as.matrix(get.adjacency(
                        watts.strogatz.game(1, 50, 8, 0.2)))
}
for (i in 11:15) {
    g[[i]] <- as.matrix(get.adjacency(
                        barabasi.game(50, power = 1,
                                      directed = FALSE)))
}
graph.cluster(g, 3)

statGraph documentation built on May 29, 2017, 9:08 a.m.