tests/testthat/test-utils.R

test_that("biggest_component works", {
  library(igraph)
  g <- make_full_graph(4) + make_full_graph(2)
  bg <- biggest_component(g)
  expect_equal(vcount(bg),4L)
})

test_that("delete_isolates works", {
  library(igraph)
  g <- make_full_graph(4) + make_full_graph(1)
  bg <- delete_isolates(g)
  expect_equal(vcount(bg),4L)
})

Try the netUtils package in your browser

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

netUtils documentation built on Oct. 11, 2024, 1:08 a.m.