ancestorGraph: Ancestor Graph

Description Usage Arguments Details Examples

View source: R/dagitty.r

Description

Creates the induced subgraph containing only the vertices in v, their ancestors, and the edges between them. All other vertices and edges are discarded.

Usage

1

Arguments

x

the input graph, a DAG, MAG, or PDAG.

v

variable names.

Details

If the input graph is a MAG or PDAG, then all *possible* ancestors will be returned (see Examples).

Examples

1
2
3
4
5
g <- dagitty("dag{ z <- x -> y }")
ancestorGraph( g, "z" )

g <- dagitty("pdag{ z -- x -> y }")
ancestorGraph( g, "y" ) # includes z

dagitty documentation built on Jan. 21, 2021, 5:07 p.m.