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 tna
communities(x, methods, gamma = 1, ...)
# S3 method for group_tna
communities(x, methods, ...)
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.
A tna
or a group_tna
object.
Ignored.
A character
vector of community detection algorithms to
apply to the network. The supported options are:
"walktrap"
: A community detection method using short random walks.
"fast_greedy"
: A method based on modularity optimization.
"label_prop"
: A method that uses label propagation.
"infomap"
: A method that uses information flow to detect communities.
"edge_betweenness"
: A method that uses edge betweenness to find
communities.
"leading_eigen"
: A method using the leading eigenvector of the
modularity matrix.
"spinglass"
: A method based on the spinglass model.
If not provided, all methods are applied.
A numeric
value depicting a parameter that affects the
behavior of certain algorithms like the Spin Glass method. Defaults to 1
.
Pattern-finding functions
plot.tna_communities()
,
plot.tna_comparison()
Cluster-related functions
bootstrap()
,
centralities()
,
cliques()
,
deprune()
,
estimate_cs()
,
group_model()
,
hist.group_tna()
,
mmm_stats()
,
plot.group_tna()
,
plot.group_tna_centralities()
,
plot.group_tna_cliques()
,
plot.group_tna_communities()
,
plot.group_tna_stability()
,
plot_compare.group_tna()
,
plot_mosaic.group_tna()
,
plot_mosaic.tna_data()
,
print.group_tna()
,
print.group_tna_bootstrap()
,
print.group_tna_centralities()
,
print.group_tna_cliques()
,
print.group_tna_communities()
,
print.group_tna_stability()
,
print.summary.group_tna()
,
print.summary.group_tna_bootstrap()
,
prune()
,
pruning_details()
,
rename_groups()
,
reprune()
,
summary.group_tna()
,
summary.group_tna_bootstrap()
model <- tna(group_regulation)
comm <- communities(model)
Run the code above in your browser using DataLab