ancestry: Node ancestry utilities

ancestryR Documentation

Node ancestry utilities

Description

Get ancestry for a collection of nodes in a graph. These functions are wrappers for the original SEMID R package.

Usage

ancestors(g, nodes)

descendants(g, nodes)

parents(g, nodes)

siblings(g, nodes)

Arguments

g

An igraph object.

nodes

the nodes in the graph of which to get the ancestry.

Value

a sorted vector of nodes.

References

Rina Foygel Barber, Mathias Drton and Luca Weihs (2019). SEMID: Identifiability of Linear Structural Equation Models. R package version 0.3.2. <https://CRAN.R-project.org/package=SEMID/>

Examples


# Get all ancestors
an <- V(sachs$graph)[ancestors(sachs$graph, "Erk")]; an

# Get parents
pa <- V(sachs$graph)[parents(sachs$graph, "PKC")]; pa

# Get descendants
de <- V(sachs$graph)[descendants(sachs$graph, "PKA")]; de

# Get siblings
sib <- V(sachs$graph)[siblings(sachs$graph, "PIP3")]; sib


SEMgraph documentation built on Sept. 11, 2024, 8:36 p.m.