check_graph: Check input graph

View source: R/input_checks.R

check_graphR Documentation

Check input graph

Description

Checks that the input graph is a valid graph for an extremal graphical model. If necessary, converts the graph to an undirected graph. Removes vertex labels if present.

Usage

check_graph(
  graph,
  graph_type = c("general", "decomposable", "block", "tree"),
  check_connected = TRUE,
  nVertices = NULL
)

Arguments

graph

An [igraph::graph] object.

graph_type

"general", "decomposable", "block", "tree". The required type of graph.

check_connected

Whether to check if the graph is connected.

nVertices

The number of vertices required in the graph.

Value

The given graph, if necessary converted to undirected. If the graph is not valid an error is thrown.

See Also

Other input validation functions: checkGamma(), check_partial_matrix_and_graph(), ensure_matrix_symmetry()


graphicalExtremes documentation built on Nov. 14, 2023, 1:07 a.m.