How to create nested node in visualization

I have the below code intending to create nested code with super node so that a super node may contain more than one node.
For example in the display below, create 3 super nodes or a single node as the super node.
library(visNetwork)
nodes <- data.frame(id=1:15,
color = c("darkred", "grey", "orange", "darkblue", "purple"),
shadow =TRUE,
label = c("John","Peter","James","Paul","Joseph","Isaiah","Isaac","Jamie","Jonah","David","Isah","Jabir","Wallace","Bros","Jonas"))
edges <- data.frame (from= c(1, 2, 3, 3, 3, 3, 3, 6, 8, 8, 8, 7, 7, 7), to= c(2, 3, 4, 5, 6, 7, 9, 8, 13, 14, 15, 10, 11,12))
visNetwork(nodes, edges, main = "Data Visualization By Freeman ", height = "700px", width = "100%") %>%
visOptions(selectedBy = "label", manipulation = TRUE,
highlightNearest = TRUE,
nodesIdSelection = TRUE) %>%
visPhysics(stabilization = TRUE)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.