build.children: Build children

Description Usage Arguments Value Examples

View source: R/graph.utility.R

Description

Build children for each node of a graph.

Usage

1
2
3
4
5

Arguments

g

a graph of class graphNEL. It represents the hierarchy of the classes.

levels

a list of character vectors. Each component represents a graph level and the elements of any component correspond to nodes. The level 0 coincides with the root node.

Value

build.children returns a named list of vectors. Each component corresponds to a node x of the graph and its vector is the set of its children.

build.children.top.down returns a named list of character vectors. Each component corresponds to a node x of the graph (i.e. parent node) and its vector is the set of its children. The nodes are ordered from root (included) to leaves.

build.children.bottom.up returns a named list of character vectors. Each component corresponds to a node x of the graph (i.e. parent node) and its vector is the set of its children. The nodes are ordered from leaves (included) to root.

Examples

1
2
3
4
5
6
data(graph);
root <- root.node(g);
children <- build.children(g);
lev <- graph.levels(g, root=root);
children.tod <- build.children.top.down(g,lev);
children.bup <- build.children.bottom.up(g,lev);

HEMDAG documentation built on Feb. 12, 2021, 5:13 p.m.