edge_data {DiagrammeR} | R Documentation

## Insert edge data attributes during edge creation

### Description

This helper function should be invoked to provide values for the namesake `edge_data` argument, which is present in any function where edges are created.

### Usage

    edge_data(...)

### Arguments

`...` | edge data attributes provided as one or more named vectors.

### Examples

    ## Not run:
    # Create a new graph and add
    # a path with several edge
    # data attributes
    graph <-
      create_graph() %>%
      add_path(
        n = 3,
        type = "path",
        edge_data = edge_data(
          hour = 5,
          index = c(1, 2)))

    # View the graph's internal
    # edge data frame; the edge
    # data attributes have
    # been inserted
    graph %>%
      get_edge_df()

    ## End(Not run)

[Package DiagrammeR version 1.0.1 Index]