Description Usage Arguments Details Examples
Creates the induced subgraph containing only the vertices
in v
, their ancestors, and the edges between them. All
other vertices and edges are discarded.
1 | ancestorGraph(x, v = NULL)
|
x |
the input graph, a DAG, MAG, or PDAG. |
v |
variable names. |
If the input graph is a MAG or PDAG, then all *possible* ancestors will be returned (see 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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.