block by timelyportfolio 109a4dabf671cc37f201

igraph + visNetwork in R

Full Screen

In response to visNetwork issue #5, here is a quick example how we might plot igraph graph with visNetwork.

library(igraph)
library(visNetwork)


graph.famous("Walther") %>%
  get.data.frame( what = "both" ) %>%
  {
    visNetwork(
      nodes = data.frame(
        id = unique( c( .[["edges"]][,"from"], .[["edges"]][,"to"] ) )
      )
      ,edges = .[["edges"]]
    )
  } %>%
  visOptions(highlightNearest = TRUE)

code.R