Learn R Programming

caugi (version 1.0.0)

same_nodes: Same nodes?

Description

Check if two caugi objects have the same nodes.

Usage

same_nodes(cg1, cg2, throw_error = FALSE)

Value

A logical indicating if the two graphs have the same nodes.

Arguments

cg1

A caugi object.

cg2

A caugi object.

throw_error

Logical; if TRUE, throws an error if the graphs do not have the same nodes.

See Also

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(), parents(), spouses(), subgraph(), topological_sort()

Examples

Run this code
cg1 <- caugi(
  A %-->% B,
  class = "DAG"
)
cg2 <- caugi(
  A %-->% B + C,
  class = "DAG"
)
same_nodes(cg1, cg2) # FALSE

Run the code above in your browser using DataLab