tests/testthat/test-endogenousstats.R

library(ghypernet)

test_that("get_zero_dummy() works", {
  recip_stat <- reciprocity_stat(adj_karate)
  recip_stat_dummy <- get_zero_dummy(recip_stat)
  names(recip_stat_dummy) <- c('reciprocity', 'reciprocity_zeroes')
  expect_equal(all(recip_stat_dummy$reciprocity_zeroes[recip_stat==0]==exp(1)), TRUE)
})

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.