View source: R/extendr-wrappers.R
| parents | R Documentation |
caugiGet parents of nodes in a graph (nodes with directed edges pointing INTO
the target node). This is equivalent to neighbors(cg, nodes, mode = "in").
Note that not both nodes and index can be given.
parents(cg, nodes = NULL, index = NULL)
cg |
A |
nodes |
A character vector of node names. |
index |
A vector of node indexes. |
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:
ancestors(),
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(),
posteriors(),
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"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.