Learn R Programming

DiagrammeR (version 0.7)

create_edges: Create a data frame with edges and their attributes

Description

Combine several named vectors for edges 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_edges(...)

Arguments

...
one or more named vectors for edges and associated attributes; the names for the named vectors must include from and to alongside any named vectors for the edge attributes and ancillary data.

Value

  • a data frame.

Examples

Run this code
# Create an edge data frame
edges <-
  create_edges(from = c("a", "b", "c"),
               to = c("d", "c", "a"),
               relationship = "leading_to")

Run the code above in your browser using DataLab