populate_edges: Populates the edges of a graph from a 'data.frame'

View source: R/builder.R

populate_edgesR Documentation

Populates the edges of a graph from a data.frame

Description

Adds a set of edges from a data.frame to a graph

Usage

populate_edges(graph_builder, edges_df, parent_col, child_col)

Arguments

graph_builder

A graph builder object

edges_df

A data.frame with a parent and child variable

parent_col

The name of the column containing the parents

child_col

The name of the column containing the children

Value

The updated graph builder object

See Also

Other build graphs: add_edge(), add_path(), build_acyclic(), build_directed(), graph_builder()

Examples

graph_edges <- data.frame(
  parent = c("A", "B", "C"),
  child = c("B", "C", "D")
)

graph_builder() |>
  populate_edges(
    edges_df = graph_edges,
    parent_col = "parent",
    child_col = "child"
  )

orbweaver documentation built on June 8, 2025, 11:40 a.m.