e_modularity: Modularity

Description Usage Arguments Modularity Note See Also Examples

View source: R/plugins.R

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

1
e_modularity(e, modularity = TRUE)

Arguments

e

An echarts4r object as returned by e_charts.

modularity

Either set to TRUE, or a list.

Modularity

Note

Does not work in RStudio viewer, open in browser.

See Also

Official documentation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
    )
  )
  

JohnCoene/echarts4r documentation built on Sept. 18, 2019, 2:24 a.m.