Learn R Programming

DiagrammeR (version 1.0.9)

edge_data: 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.

See Also

Other Edge creation and removal: add_edge_clone(), add_edge_df(), add_edges_from_table(), add_edges_w_string(), add_edge(), add_forward_edges_ws(), add_reverse_edges_ws(), copy_edge_attrs(), create_edge_df(), delete_edges_ws(), delete_edge(), delete_loop_edges_ws(), drop_edge_attrs(), join_edge_attrs(), mutate_edge_attrs_ws(), mutate_edge_attrs(), recode_edge_attrs(), rename_edge_attrs(), rescale_edge_attrs(), rev_edge_dir_ws(), rev_edge_dir(), set_edge_attr_to_display(), set_edge_attrs_ws(), set_edge_attrs()

Examples

Run this code
if (FALSE) {
# 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()
}

Run the code above in your browser using DataLab