same_nodes: Same nodes?

View source: R/queries.R

same_nodesR Documentation

Same nodes?

Description

Check if two caugi objects have the same nodes.

Usage

same_nodes(cg1, cg2, throw_error = FALSE)

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.

Value

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

See Also

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

Examples

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


caugi documentation built on Oct. 28, 2026, 1:07 a.m.