Learn R Programming

DiagrammeR (version 0.8.1)

create_nodes: Create a data frame with nodes and their attributes

Description

Combine several named vectors for nodes and their attributes into a data frame, which can be combined with other similarly-generated data frame, or, added to a graph object.

Usage

create_nodes(...)

Arguments

...
one or more named vectors for nodes and associated attributes.

Value

  • a data frame.

Examples

Run this code
# Create a node data frame
nodes <-
  create_nodes(nodes = c("a", "b", "c", "d"),
               label = TRUE,
               type = c("lower", "lower", "upper", "upper"),
               style = "filled",
               color = "aqua",
               shape = c("circle", "circle",
                         "rectangle", "rectangle"),
               data = c(3.5, 2.6, 9.4, 2.7))

Run the code above in your browser using DataLab