object <- as(datasets::mtcars, "DFrame")
test_that("Check that 'interestingGroups' column gets defined as factor.", {
x <- uniteInterestingGroups(
object = object,
interestingGroups = c("vs", "am", "gear")
)
expect_identical(
levels(x[["interestingGroups"]]),
c("0:0:3", "0:1:4", "0:1:5", "1:0:3", "1:0:4", "1:1:4", "1:1:5")
)
})
test_that("Error on missing groups.", {
expect_error(
object = uniteInterestingGroups(
object = object,
interestingGroups = c("XXX", "YYY")
),
regexp = "isSubset.*interestingGroups"
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.