Communities {rags2ridges} | R Documentation |
Search and visualize community-structures
Description
Function that searches for and visualizes community-structures in graphs.
Usage
Communities(
P,
graph = TRUE,
lay = "layout_with_fr",
coords = NULL,
Vsize = 15,
Vcex = 1,
Vcolor = "orangered",
VBcolor = "darkred",
VLcolor = "black",
main = ""
)
Arguments
P |
Sparsified precision |
graph |
A |
lay |
A |
coords |
A |
Vsize |
A |
Vcex |
A |
Vcolor |
A |
VBcolor |
A |
VLcolor |
A |
main |
A |
Details
Communities in a network are groups of vertices (modules) that are densely connected within. Community search is performed by the Girvan-Newman algorithm (Newman and Girvan, 2004).
When graph = TRUE
the community structure in the graph is visualized.
The default layout is according to the Fruchterman-Reingold algorithm
(1991). Most layout functions supported by igraph
are
supported (the function is partly a wrapper around certain
igraph
functions). The igraph layouts can be invoked by a
character
that mimicks a call to a igraph
layout
functions in the lay
argument. When using lay = NULL
one can
specify the placement of vertices with the coords
argument. The row
dimension of this matrix should equal the number of vertices. The column
dimension then should equal 2 (for 2D layouts) or 3 (for 3D layouts). The
coords
argument can also be viewed as a convenience argument as it
enables one, e.g., to layout a graph according to the coordinates of a
previous call to Ugraph
. If both the the lay and the coords arguments
are not NULL
, the lay argument takes precedence. Communities are
indicated by color markings.
Value
An object of class list:
membership |
|
modularityscore |
|
When graph = TRUE
the function also returns a graph.
Author(s)
Carel F.W. Peeters <carel.peeters@wur.nl>
References
Csardi, G. and Nepusz, T. (2006). The igraph software package for complex network research. InterJournal, Complex Systems 1695. http://igraph.sf.net
Fruchterman, T.M.J., and Reingold, E.M. (1991). Graph Drawing by Force-Directed Placement. Software: Practice & Experience, 21: 1129-1164.
Newman, M. and Girvan, M. (2004). Finding and evaluating community structure in networks. Physical Review E, 69: 026113.
See Also
Examples
## Obtain some (high-dimensional) data
p = 25
n = 10
set.seed(333)
X = matrix(rnorm(n*p), nrow = n, ncol = p)
colnames(X)[1:25] = letters[1:25]
## Obtain regularized precision under optimal penalty
OPT <- optPenalty.LOOCV(X, lambdaMin = .5, lambdaMax = 30, step = 100)
## Determine support regularized standardized precision under optimal penalty
PC0 <- sparsify(symm(OPT$optPrec), threshold = "localFDR")$sparseParCor
## Search and visualize communities
Commy <- Communities(PC0)