communities | R Documentation |
This function detects communities within the transition networks
(represented by the tna
object).
It uses various algorithms to find communities in the graph representation
of transitions and returns a list
of communities for each cluster or a
specified cluster. If multiple transition matrices exist, the function
iterates over each cluster in the tna
object to find communities using
different algorithms. The function uses the igraph
package to convert
the transition matrices into graphs and then applies community detection
algorithms (e.g., Walktrap, Fast Greedy, Label Propagation, Infomap,
Edge Betweenness, Leading Eigenvector, and Spin Glass).
communities(x, ...)
## S3 method for class 'tna'
communities(x, methods, gamma = 1, ...)
## S3 method for class 'group_tna'
communities(x, methods, gamma = 1, ...)
x |
A |
... |
Ignored. |
methods |
A
If not provided, all methods are applied. |
gamma |
A |
An object of class tna_communities
which is a list
with an
element for each cluster containing:
counts
: A list
with the number of communities found
by each algorithm.
assignments
: A data.frame
where each row corresponds to a
node and each column to a community detection algorithm,
with color-coded community assignments.
If x
is a group_tna
object, a group_tna_communities
object is returned
instead, which is a list
of tna_communities
objects.
Community detection functions
plot.group_tna_communities()
,
plot.tna_communities()
,
print.group_tna_communities()
,
print.tna_communities()
Cluster-related functions
group_model()
,
mmm_stats()
,
rename_groups()
model <- tna(group_regulation)
comm <- communities(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.