Skip to contents

Check if two caugi_graph objects have the same nodes.

Usage

same_nodes(cg1, cg2, throw_error = FALSE)

Arguments

cg1

A caugi_graph object.

cg2

A caugi_graph 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.

Examples

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