Skip to contents

Checks if the given caugi graph is an undirected graph (UG).

Usage

is_ug(cg, force_check = FALSE)

Arguments

cg

A caugi object.

force_check

Logical; if TRUE, the function will test if the graph is an UG, if FALSE (default), it will look at the graph class and match it, if possible.

Value

A logical value indicating whether the graph is an UG.

Examples

cg_ug_class <- caugi(
  A %---% B,
  class = "UG"
)
is_ug(cg_ug_class) # TRUE
#> [1] TRUE
cg_not_ug <- caugi(
  A %-->% B,
  class = "DAG"
)
is_ug(cg_not_ug) # FALSE
#> [1] FALSE