View source: R/visClustering.R
visClusteringByConnection | R Documentation |
Network visualization clustering options - by node id
visClusteringByConnection(graph, nodes)
graph |
: a visNetwork object |
nodes |
: Character/vector. id of nodes we want to cluster |
set.seed(124) nodes <- data.frame(id = 1:10, color = c(rep("blue", 6), rep("red", 3), rep("green", 1))) edges <- data.frame(from = round(runif(6)*10), to = round(runif(6)*10)) visNetwork(nodes, edges) %>% visClusteringByConnection(nodes = 9)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.