tests/testthat/test-treeConversionigraph.R

context("tree conversion igraph")


test_that("as.Node.igraph undirected", {
  skip_if_not_installed("igraph")

  data(acme)
  ig <- as.igraph.Node(acme, "p", c("level", "isLeaf"), directed = FALSE)
  #expect_true(is_hierarchical(ig))
  expect_false(igraph::is_directed(ig))
  expect_equal(igraph::gsize(ig), acme$totalCount - 1)
})


test_that("as.Node.igraph directed", {
  skip_if_not_installed("igraph")
  data(acme)
  ig <- as.igraph.Node(acme, "p", c("level", "isLeaf"), directed = TRUE)
  #expect_true(is_hierarchical(ig))
  expect_true(igraph::is_directed(ig))
  expect_equal(igraph::gsize(ig), acme$totalCount - 1)
})

Try the data.tree package in your browser

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

data.tree documentation built on Nov. 13, 2023, 1:08 a.m.