visnetwork: Render graph with visNetwork

Description Usage Arguments Examples

View source: R/visnetwork.R

Description

Render a graph object with the visNetwork R package.

Usage

1
visnetwork(graph)

Arguments

graph

a dgr_graph object, created using the create_graph function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
# 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)

## End(Not run)

Example output

Warning message:
In file(con, "rb") : cannot open file '/etc/timezone': Permission denied

DiagrammeR documentation built on Sept. 7, 2017, 1:06 a.m.