build.consistent.graph {HEMDAG} | R Documentation |
Build consistent graph
Description
Build a graph in which all nodes are reachable from root.
Usage
build.consistent.graph(g = g, root = "00")
Arguments
g |
an object of class |
root |
name of the class that is on the top-level of the hierarchy ( |
Details
All nodes not accessible from root (if any) are removed from the graph and printed on stdout.
Value
A graph (as an object of class graphNEL
) in which all nodes are accessible from root.
Examples
data(graph);
root <- root.node(g);
G <- graph::addNode(c("X","Y","Z"), g);
G <- graph::addEdge(c("X","Y","Z"), c("HP:0011844","HP:0009810","HP:0012385"), G);
G <- build.consistent.graph(G, root=root);
[Package HEMDAG version 2.7.4 Index]