compute_graph_modul {graph4lg} | R Documentation |
Compute modules from a graph by maximising modularity
Description
The function computes modules from a graph by maximising modularity.
Usage
compute_graph_modul(
graph,
algo = "fast_greedy",
node_inter = NULL,
nb_modul = NULL
)
Arguments
graph |
An object of class |
algo |
A character string indicating the algorithm used to create the modules with igraph.
|
node_inter |
(optional, default = NULL) A character string indicating whether the links of the graph are weighted by distances or by similarity indices. It is only used to compute the modularity index. It can be:
|
nb_modul |
(optional , default = NULL) A numeric or integer value indicating the number of modules in the graph. When this number is not specified, the optimal value is retained. |
Value
A data.frame
with the node names and the corresponding
module ID.
Author(s)
P. Savary
Examples
data("data_tuto")
mat_gen <- data_tuto[[1]]
graph <- gen_graph_thr(mat_w = mat_gen, mat_thr = mat_gen,
thr = 0.8)
res_mod <- compute_graph_modul(graph = graph,
algo = "fast_greedy",
node_inter = "distance")