tests/testthat/test-check_strata.R

test_that(
  "`check_strata()` throws an error when elements that don't exactly
          match the columns of `pop_data` are provided",
  {
    sees_pop_data_pk_100 |>
      check_strata(strata = c("ag", "catch", "Count")) |>
      expect_error(class = "missing_var")
  }
)

test_that("`check_strata()` throws an error when `strata` is not a `character`",
          {
            sees_pop_data_pk_100 |>
              check_strata(strata = c(1, 4)) |>
              expect_error(class = "strata are not strings")
          })

Try the serocalculator package in your browser

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

serocalculator documentation built on April 3, 2025, 7:35 p.m.