Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

visnetwork

Render graph with visNetwork


Description

Render a graph object with the visNetwork R package.

Usage

visnetwork(graph)

Arguments

graph

A graph object of class dgr_graph.

Examples

# Create a node data frame (ndf)
ndf <-
  create_node_df(
    n = 6,
    label = TRUE,
    fillcolor = c("lightgrey", "red", "orange",
                  "pink", "aqua", "yellow"),
    shape = "dot",
    size = c(20, 80, 40, 10, 30, 50),
    type = c("1", "1", "1", "2", "2", "2")
  )

# Create an edge data frame (edf)
edf <-
  create_edge_df(
    from = c(1, 2, 3, 4, 6, 5),
    to = c(4, 3, 1, 3, 1, 4),
    color = c("green", "green", "grey",
              "grey", "blue", "blue"),
    rel = "leading_to"
  )

# Create a graph object
graph <-
  create_graph(
    nodes_df = ndf,
    edges_df = edf
  )

# visnetwork(graph)

DiagrammeR

Graph/Network Visualization

v1.0.6.1
MIT + file LICENSE
Authors
Richard Iannone [aut, cre] (<https://orcid.org/0000-0003-3925-190X>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.