View source: R/extendr-wrappers.R
| ancestors | R Documentation |
caugiGet ancestors of nodes in a caugi
ancestors(
cg,
nodes = NULL,
index = NULL,
open = caugi_options("use_open_graph_definition")
)
cg |
A |
nodes |
A character vector of node names. |
index |
A vector of node indexes. |
open |
Boolean. Determines how the graph is interpreted when retrieving ancestors.
Default is taken from |
Either a character vector of node names (if a single node is requested) or a list of character vectors (if multiple nodes are requested).
Other queries:
anteriors(),
children(),
components(),
descendants(),
districts(),
edge_types(),
edges(),
exogenous(),
is_acyclic(),
is_admg(),
is_ag(),
is_caugi(),
is_cpdag(),
is_dag(),
is_empty_caugi(),
is_mag(),
is_mpdag(),
is_pdag(),
is_simple(),
is_ug(),
m_separated(),
markov_blanket(),
neighbors(),
nodes(),
parents(),
posteriors(),
same_nodes(),
spouses(),
subgraph(),
topological_sort()
cg <- caugi(
A %-->% B,
B %-->% C,
class = "DAG"
)
ancestors(cg, "A") # NULL
ancestors(cg, "A", open = FALSE) # A
ancestors(cg, index = 2) # "A"
ancestors(cg, "B") # "A"
ancestors(cg, c("B", "C"))
#> $B
#> [1] "A"
#>
#> $C
#> [1] "A" "B"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.