Learn R Programming

DiagrammeR (version 0.7)

combine_edges: Combine multiple edge data frames into a single edge data frame

Description

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

Usage

combine_edges(...)

Arguments

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

Value

  • a combined edge data frame.

Examples

Run this code
# Combine two edge data frames
edges_1 <-
  create_edges(from = c("a", "a", "b", "c"),
               to = c("b", "d", "d", "a"),
               relationship = "requires",
               color = "green",
               data = c(2.7, 8.9, 2.6, 0.6))

edges_2 <-
  create_edges(from = c("e", "g", "h", "h"),
               to = c("g", "h", "f", "e"),
               relationship = "receives",
               arrowhead = "dot",
               color = "red")

all_edges <- combine_edges(edges_1, edges_2)

Run the code above in your browser using DataLab