Skip to main content

Graph class predicates

Source: R/queries.R, R/jlbind-wrappers.R

Description

Test which class a graph belongs to, or its structural properties. The class predicates are is_dag(), is_pdag(), is_cpdag(), is_mpdag(), is_ug(), is_admg(), is_ag(), is_mag() and is_pag(); the structural ones are is_simple() and is_acyclic().

Usage

is_dag(cg)

is_pdag(cg)

is_cpdag(cg)

is_mpdag(cg)

is_ug(cg)

is_admg(cg)

is_ag(cg)

is_mag(cg)

is_pag(cg)

is_simple(cg)

is_acyclic(cg)

Arguments

cg A graph created with cgraph(), of any class.

Details

These test the actual edge structure of cg, independent of the class it has.

Value

A logical scalar.

Examples

dag <- cgraph(A %-->% B, class = "PDAG")
is_dag(dag) # TRUE, even though assigned PDAG
#> [1] TRUE
is_ug(dag)
#> [1] FALSE
is_acyclic(dag)
#> [1] TRUE