tests/testthat/test_subset_clusters_by_id.R

context("Subsetting clusters by ID")

test_that("Returns clusters with the correct ids", {

    skip_on_cran()

    x <- make_epicontacts(ebola_sim$linelist, ebola_sim$contacts,
                           id = "case_id", to = "case_id", from = "infector",
                           directed = FALSE)

    test.ids <- ebola_sim$linelist$case_id[1:1000]

    y <- subset_clusters_by_id(x,id = test.ids)

    expect_equal(sum(y$linelist$id %in% test.ids),1000)

})

Try the epicontacts package in your browser

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

epicontacts documentation built on March 31, 2023, 6:49 p.m.