getCommunityMatrix: Construct a Community Membership Matrix

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/linkcomm_misc.R

Description

This function returns a binary matrix with nodes as rows, communities as columns, and unit entries indicating membership in a community.

Usage

1
getCommunityMatrix(x, nodes = head(names(x$numclusters), 20))

Arguments

x

An object of class linkcomm.

nodes

A character vector containing the nodes for the community membership matrix. Defaults to the 20 (or less) nodes that belong to the most communities.

Value

A binary matrix with nodes as rows and communities as columns.

Author(s)

Alex T. Kalinka alex.t.kalinka@gmail.com

References

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.

See Also

plot.linkcomm

Examples

1
2
3
4
5
6
## Generate graph and extract link communities.
g <- swiss[,3:4]
lc <- getLinkCommunities(g)

## Get community membership matrix.
getCommunityMatrix(lc)

alextkalinka/linkcomm documentation built on Feb. 11, 2021, 4:53 a.m.