View source: R/graph-functions.R
| f.descendants | R Documentation |
Function to extract the descendants of a node OR nodes in a graph object. Descendants of a node Vi are set Vj such that there is a directed path Vi->...->Vj. Descendants set including Vi itself by convention.
f.descendants(graph, nodes)
graph |
A graph object generated by the |
nodes |
A character vector of nodes for which to extract children. |
A vector of vertices contains descendants set of the given nodes.
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.descendants(graph, c('A'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.