e_modularity {echarts4r} | R Documentation |
Modularity
Description
Graph modularity extension will do community detection and partian a graph's vertices in several subsets. Each subset will be assigned a different color.
Usage
e_modularity(e, modularity = TRUE)
Arguments
e |
An |
modularity |
Either set to |
Modularity
resolution
Resolutionsort
Whether to sort to comunities
Note
Does not work in RStudio viewer, open in browser.
See Also
Examples
nodes <- data.frame(
name = paste0(LETTERS, 1:100),
value = rnorm(100, 10, 2),
stringsAsFactors = FALSE
)
edges <- data.frame(
source = sample(nodes$name, 200, replace = TRUE),
target = sample(nodes$name, 200, replace = TRUE),
stringsAsFactors = FALSE
)
e_charts() |>
e_graph() |>
e_graph_nodes(nodes, name, value) |>
e_graph_edges(edges, source, target) |>
e_modularity(
list(
resolution = 5,
sort = TRUE
)
)
[Package echarts4r version 0.4.5 Index]