tests/testthat/test_getEdges.R

testthat::test_that('test getEdges', {
  x <- fixNodeBias(head(mtcars[,c("cyl", "gear")]))
  nodes <- getNodes(x, group =T)
  association <- getAssociation(x)
  res <- getEdges(association, nodes)
  testthat::expect_true(is.data.frame(res))
  testthat::expect_true(res$from[1] == 1)
  testthat::expect_true(res$to[1] == 4)
  testthat::expect_true(length(res) == 2)
  testthat::expect_true(nrow(res) == 4)
})

Try the netknitr package in your browser

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

netknitr documentation built on April 3, 2025, 5:47 p.m.