Learn R Programming

dagitty (version 0.1-9)

AncestralRelations: Ancestral Relations

Description

Retrieve the names of all variables in a given graph that are in the specified ancestral relationship to the input variable v.

Usage

descendants(x, v)

ancestors(x, v)

children(x, v)

parents(x, v)

neighbours(x, v)

spouses(x, v)

adjacentNodes(x, v)

markovBlanket(x, v)

Arguments

x
the input graph, of any type.
v
name(s) of variable(s).

descendants(x,v) retrieves variables that are are reachable from v via a directed path.

ancestors(x,v) retrieves variables from which v is reachable via a directed path.

Examples

Run this code
g <- dagitty("graph{ a <-> x -> b ; c -- x <- d }")
descendants(g,"x")
parents(g,"x")
spouses(g,"x")

Run the code above in your browser using DataLab