tests/testthat/test-blockmodel.R

library(ghypernet)

test_that("bccm with identical labels works", {
  m <- bccm(adj_karate, labels = rep(1,nrow(adj_karate)))
  expect_equal(class(m), 'ghype')
})

test_that("bccm works with bipartite graphs", {
  b <- adj_karate[sample(34,15),sample(34,19)]
  m <- bccm(adj = b, labels = list(vertexlabels[sample(34,15)],vertexlabels[sample(34,19)]), multinomial = TRUE)
  expect_equal(class(m), c("bccm","ghypeBlock","ghype"))
})

Try the ghypernet package in your browser

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

ghypernet documentation built on Oct. 15, 2021, 5:14 p.m.