Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/linkcomm_misc.R
This function hierarchically clusters the link communities themselves and returns an object of class hclust
.
1 2 3 4 |
x |
An object of class |
clusterids |
An integer vector of community IDs. Defaults to all communities. |
hcmethod |
A character string naming the hierarchical clustering method to use. Can be one of |
cluster |
Logical, whether to cluster the communities. If FALSE, the function returns the upper triangular dissimilarity matrix as a vector. Defaults to TRUE. |
plot |
Logical, whether to plot the cluster dendrogram. |
cutat |
A numerical value at which to cut the dendrogram. If NULL, the dendrogram is not cut and meta-communities are not returned. Defaults to NULL. |
col |
Logical, whether to colour the dendrogram. Defaults to TRUE. |
pal |
A character vector describing a colour palette to be used for colouring the meta-communites in the dendrogram plot. Defaults to |
labels |
Logical, whether to add labels to the dendrogram plot. |
plotcut |
Logical, whether to display a horizontal line where the dendrogram is cut. Defaults to TRUE. |
right |
Logical, whether to orient the dendrogram to the right. Defaults to TRUE. |
verbose |
Logical, whether to display the progress of the calculation on the screen. Defaults to TRUE. |
... |
Additional arguments to be passed to |
Extracting meta-communities allows the user to explore community relatedness and structure at higher levels. Community relatedness is calculated using the Jaccard coefficient and the number of nodes that community i and j share:
S(i,j)=|intersect(i,j)|/|union(i,j)|
Either a numerical vector (the upper triangular dissimilarity matrix - if cluster = FALSE
), a list of integer vectors (the meta-communities - if cutat
is not NULL), or an object of class hclust
(if cluster
is TRUE and cutat
is NULL).
Alex T. Kalinka alex.t.kalinka@gmail.com
Kalinka, A.T. and Tomancak, P. (2011). linkcomm: an R package for the generation, visualization, and analysis of link communities in networks of arbitrary size and type. Bioinformatics 27, 2011-2012.
meta.communities
, cutDendrogramAt
, hclust
1 2 3 4 5 6 7 8 9 | ## Generate graph and extract link communities.
g <- swiss[,3:4]
lc <- getLinkCommunities(g)
## Cluster the link communities.
getClusterRelatedness(lc)
## Cluster the link communities, cut the dendrogram, and return the meta-communities.
getClusterRelatedness(lc, cutat = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.