tests/testthat/test-as_graph.R

if (requireNamespace("gMCP", quietly = TRUE)) {
  test_that("round-trip graph coercion - gMCP", {
    g <- random_graph(11)

    expect_equal(g, as_initial_graph(as_graphMCP(g)))
  })
}

if (requireNamespace("igraph", quietly = TRUE)) {
  test_that("round-trip graph coercion - igraph", {
    g <- random_graph(11)

    expect_equal(g, as_initial_graph(as_igraph(g)))
  })
}

Try the graphicalMCP package in your browser

Any scripts or data that you put into this service are public.

graphicalMCP documentation built on June 8, 2025, 11:19 a.m.