visClusteringByGroup {visNetwork} | R Documentation

## Network visualization clustering options - by group

### Description

Network visualization clustering options - by group.

### Usage

    visClusteringByGroup(graph, groups)

### Arguments

`graph` | : a visNetwork object
`groups` | : Character/vector. groups we want to cluster

### Examples

    nodes <- data.frame(id = 1:10, label = paste("Label", 1:10),
       group = sample(c("A", "B"), 10, replace = TRUE))
     edges <- data.frame(from = c(2,5,10), to = c(1,2,10))

     visNetwork(nodes, edges, legend = TRUE) %>%
       visGroups(groupname = "A", color = "red", shape = "database") %>%
       visGroups(groupname = "B", color = "yellow", shape = "triangle") %>%
       visClusteringByGroup(groups = c("B"))

[Package visNetwork version 0.2.1 Index]