tests/testthat/test-extract_groups.R

library(AnthropMMD)

## Import dataset and transform it to a table of frequencies:
data(toyMMD)
tab <- binary_to_table(toyMMD, relative = FALSE)
expected <- paste("Group", LETTERS[1:5], sep = "")

## Check if the groups names can be extracted:
test_that("Group names OK for binary data:", {
    expect_equal(extract_groups(toyMMD, type = "raw"), expected)
})
test_that("Group names OK for tables:", {
    expect_equal(extract_groups(tab, type = "table"), expected)
})

Try the AnthropMMD package in your browser

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

AnthropMMD documentation built on Aug. 8, 2023, 5:12 p.m.