From 4e40a165bdc205599aa935a8bc558d014fb557f7 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 21 Mar 2024 13:29:08 +0100 Subject: [PATCH] Update test-check_outliers.R --- tests/testthat/test-check_outliers.R | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test-check_outliers.R b/tests/testthat/test-check_outliers.R index f0f381971..c07917f6a 100644 --- a/tests/testthat/test-check_outliers.R +++ b/tests/testthat/test-check_outliers.R @@ -201,6 +201,12 @@ test_that("multiple methods which", { # We exclude method ics because it is too slow test_that("all methods which", { skip_if_not_installed("bigutilsr") + skip_if_not_installed("MASS") + skip_if_not_installed("dbscan") + skip_if_not_installed("ICS") + skip_if_not_installed("ICSOutlier") + skip_if_not_installed("loo") + expect_identical( which(check_outliers(mtcars, method = c( @@ -224,7 +230,13 @@ test_that("all methods which", { test_that("multiple methods with ID", { skip_if_not_installed("bigutilsr") - data <- datawizard::rownames_as_column(mtcars, var = "car") + skip_if_not_installed("MASS") + skip_if_not_installed("dbscan") + skip_if_not_installed("ICS") + skip_if_not_installed("ICSOutlier") + skip_if_not_installed("loo") + + data <- datawizard::rownames_as_column(mtcars, var = "car") x <- attributes(check_outliers(data, method = c( "zscore", "zscore_robust", "iqr", "ci", "eti", "hdi", "bci", @@ -282,6 +294,7 @@ test_that("cook multiple methods which", { test_that("pareto which", { skip_if_not_installed("dbscan") + skip_if_not_installed("loo") skip_if_not_installed("rstanarm") set.seed(123) model <- rstanarm::stan_glm(mpg ~ qsec + wt, data = mtcars, refresh = 0) @@ -295,6 +308,7 @@ test_that("pareto which", { test_that("pareto multiple methods which", { skip_if_not_installed("dbscan") + skip_if_not_installed("loo") skip_if_not_installed("rstanarm") set.seed(123) model <- rstanarm::stan_glm(mpg ~ qsec + wt, data = mtcars, refresh = 0)