From 7caea04fb1f447b6cb6c176df422b21b5604ce31 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 4 Oct 2023 12:42:16 +0200 Subject: [PATCH] add test --- tests/testthat/test-check_heterogeneity_bias.R | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/testthat/test-check_heterogeneity_bias.R diff --git a/tests/testthat/test-check_heterogeneity_bias.R b/tests/testthat/test-check_heterogeneity_bias.R new file mode 100644 index 000000000..2ae8fead3 --- /dev/null +++ b/tests/testthat/test-check_heterogeneity_bias.R @@ -0,0 +1,8 @@ +test_that("check_heterogeneity_bias", { + data(iris) + set.seed(123) + iris$ID <- sample(1:4, nrow(iris), replace = TRUE) # fake-ID + out <- check_heterogeneity_bias(iris, select = c("Sepal.Length", "Petal.Length"), group = "ID") + expect_equal(out, c("Sepal.Length", "Petal.Length"), ignore_attr = TRUE) + expect_output(print(out), "Possible heterogeneity bias due to following predictors: Sepal\\.Length, Petal\\.Length") +})