tests/testthat/test-corr-groups.R

context("find correlated groups")

groups1 <- corr_groups(mtcars)
groups2 <- corr_groups(mtcars, cor_mat = TRUE)

test_that("one correlated group is found in mtcars", {
  expect_equal(length(groups1), 1)
  
  expect_identical(groups1[[1]], c("disp", "cyl"))
})

test_that("matrix is returned", {
  expect_equal(class(groups2[[1]]), "matrix")
})
NateByers/IUHhelpers documentation built on Feb. 25, 2020, 8:43 p.m.