Learn R Programming

caugi (version 1.0.0)

is_admg: Is the caugi graph an ADMG?

Description

Checks if the given caugi graph is an Acyclic Directed Mixed Graph (ADMG).

An ADMG contains only directed (-->) and bidirected (<->) edges, and the directed part must be acyclic.

Usage

is_admg(cg, force_check = FALSE)

Value

A logical value indicating whether the graph is an ADMG.

Arguments

cg

A caugi object.

force_check

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

See Also

Other queries: ancestors(), anteriors(), children(), descendants(), districts(), edge_types(), edges(), exogenous(), is_acyclic(), is_ag(), is_caugi(), is_cpdag(), is_dag(), is_empty_caugi(), is_mag(), is_pdag(), is_ug(), m_separated(), markov_blanket(), neighbors(), nodes(), parents(), same_nodes(), spouses(), subgraph(), topological_sort()

Examples

Run this code
cg_admg <- caugi(
  A %-->% B,
  A %<->% C,
  class = "ADMG"
)
is_admg(cg_admg) # TRUE

cg_dag <- caugi(
  A %-->% B,
  class = "DAG"
)
is_admg(cg_dag) # TRUE (DAGs are valid ADMGs)

Run the code above in your browser using DataLab