Nothing
x <- SDMtune:::t
test_that("The function raises error", {
expect_snapshot_error(corVar(x@data))
})
test_that("The function creates the correct output", {
cm <- corVar(x)
expect_equal(class(cm), "data.frame")
expect_named(cm, c("Var1", "Var2", "value"))
expect_true(abs(min(corVar(x, cor_th = 0.8)$value)) >= 0.8)
# The output is ordered if order = TRUE
expect_true(abs(cm$value[1]) >= abs(cm$value[2]))
cm1 <- corVar(x, order = FALSE)
expect_false(abs(cm1$value[1]) >= abs(cm1$value[2]))
# The diagonal is removed if remove_diagonal = TRUE
expect_true(cm[1, 3] != 1)
cm1 <- corVar(x, remove_diagonal = FALSE)
expect_equal(cm1[1, 3], 1)
# The first 2 columns are factors
expect_true(is.factor(cm[, 1]))
expect_true(is.factor(cm[, 2]))
})
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.