f.children: Get the children of a node OR nodes in a graph.

View source: R/graph-functions.R

f.childrenR Documentation

Get the children of a node OR nodes in a graph.

Description

Function to extract the children of a node OR nodes in a graph object. Children of a node are the nodes that have edges from the given node.

Usage

f.children(graph, nodes)

Arguments

graph

A graph object generated by the make.graph() function.

nodes

A character vector of nodes for which to extract children.

Value

A vector of vertices contains children set of the given nodes.

Examples

graph <- make.graph(vertices=c('A','M','L','Y','X'),
bi_edges=list(c('A','Y')),
di_edges=list(c('X','A'), c('X','M'), c('X','L'),
c('X','Y'), c('M','Y'), c('A','M'), c('A','L'), c('M','L'), c('L','Y')))
f.children(graph, c('A'))


flexCausal documentation built on March 29, 2026, 5:08 p.m.