powered by
caugi
Get parents of nodes in a graph (nodes with directed edges pointing INTO the target node). This is equivalent to neighbors(cg, nodes, mode = "in").
neighbors(cg, nodes, mode = "in")
Note that not both nodes and index can be given.
parents(cg, nodes = NULL, index = NULL)
Either a character vector of node names (if a single node is requested) or a list of character vectors (if multiple nodes are requested).
A caugi object.
A vector of node names, a vector of unquoted node names, or an expression combining these with + and c().
+
c()
A vector of node indexes.
Other queries: ancestors(), anteriors(), children(), descendants(), districts(), edge_types(), edges(), exogenous(), is_acyclic(), is_admg(), is_ag(), is_caugi(), is_cpdag(), is_dag(), is_empty_caugi(), is_mag(), is_pdag(), is_ug(), m_separated(), markov_blanket(), neighbors(), nodes(), same_nodes(), spouses(), subgraph(), topological_sort()
ancestors()
anteriors()
children()
descendants()
districts()
edge_types()
edges()
exogenous()
is_acyclic()
is_admg()
is_ag()
is_caugi()
is_cpdag()
is_dag()
is_empty_caugi()
is_mag()
is_pdag()
is_ug()
m_separated()
markov_blanket()
neighbors()
nodes()
same_nodes()
spouses()
subgraph()
topological_sort()
cg <- caugi( A %-->% B, B %-->% C, class = "DAG" ) parents(cg, "A") # NULL parents(cg, index = 2) # "A" parents(cg, "B") # "A" parents(cg, c("B", "C")) #> $B #> [1] "A" #> #> $C #> [1] "B"
Run the code above in your browser using DataLab