Learn R Programming

DiagrammeR (version 0.8.4)

combine_nodes: Combine multiple node data frames into a single node data frame

Description

Combine several node data frames in the style of rbind, except, it works regardless of the number and ordering of the columns.

Usage

combine_nodes(...)

Arguments

...
two or more node data frames, which contain node IDs and associated attributes.

Value

a combined node data frame.

Examples

Run this code
## Not run: 
# # Create a node data frame (ndf)
# nodes_1 <-
#   create_nodes(
#     nodes = c("a", "b", "c", "d"),
#     label = FALSE,
#     type = "lower",
#     style = "filled",
#     color = "aqua",
#     shape = c("circle", "circle",
#               "rectangle", "rectangle"),
#     data = c(3.5, 2.6, 9.4, 2.7))
# 
# # Create another ndf
# nodes_2 <-
#   create_nodes(
#     nodes = c("e", "f", "g", "h"),
#     label = FALSE,
#     type = "upper",
#     style = "filled",
#     color = "red",
#     shape = "triangle",
#     data = c(0.5, 3.9, 3.7, 8.2))
# 
# # Combine the two node data frames
# all_nodes <-
#   combine_nodes(nodes_1, nodes_2)
# ## End(Not run)

Run the code above in your browser using DataLab