Nothing
test_that("cramer_v computes Cramer's V correctly with mtcars example", {
data(mtcars)
mtcars$gear <- as.factor(mtcars$gear)
mtcars$cyl <- as.factor(mtcars$cyl)
tab <- table(mtcars$gear, mtcars$cyl)
result <- suppressWarnings(cramer_v(tab))
expect_type(result, "double")
expect_length(result, 1)
expect_gte(result, 0)
expect_lte(result, 1)
})
test_that("cramer_v fails gracefully with non-table input", {
expect_error(
cramer_v(iris),
"`x` must be a contingency table \\(class `table`\\)\\."
)
expect_error(
cramer_v(1:10),
"`x` must be a contingency table \\(class `table`\\)\\."
)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.