has_children: Checks if a node in a graph has children

View source: R/has_children.R View source: R/extendr-wrappers.R View source: R/extendr-wrappers.R

has_childrenR Documentation

Checks if a node in a graph has children

Description

This function validates if the node has an edge pointing to any other node.

Usage

has_children(graph, nodes)

Arguments

graph

A graph object

nodes

A character vector of nodes to determine

Value

A logical vector with the same length as nodes

Examples

graph <- graph_builder() |>
  add_edge(from = "A", to = "B") |>
  build_directed()
graph

graph |> has_children(nodes = "A")
graph |> has_children(nodes = "B")

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