diff --git a/DESCRIPTION b/DESCRIPTION
index 7bf4f1f4d..09996d4b3 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Type: Package
Package: see
Title: Model Visualisation Toolbox for 'easystats' and 'ggplot2'
-Version: 0.14.0.9
+Version: 0.14.0.10
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
diff --git a/R/scale_color_colorhex.R b/R/scale_color_colorhex.R
index 74586a675..cca876576 100644
--- a/R/scale_color_colorhex.R
+++ b/R/scale_color_colorhex.R
@@ -173,29 +173,28 @@ scale_fill_colorhex_c <- function(
# Palette --------------------------------------------------------------------
-#' Color palettes from
+#' Color palettes from color-hex.com.
#'
-#' This function downloads a requested color palette from .
+#' This function downloads a requested color palette from color-hex.com.
#' This website provides a large number of user-submitted color palettes.
#'
#' @note
-#' The default [Josiah color palette (number 1014416)](https://www.color-hex.com/color-palette/1014416)
-#' is available without an internet connection. All other color palettes require
-#' an internet connection to download and access.
+#' The default Josiah color palette (number 1014416) is available without an
+#' internet connection. All other color palettes require an internet connection
+#' to download and access.
#'
-#' @param palette The numeric code for a palette at .
-#' For example, `1014416` for the
-#' [Josiah color palette (number 1014416)](https://www.color-hex.com/color-palette/1014416).
+#' @param palette The numeric code for a palette at color-hex.com. For example,
+#' `1014416` for the Josiah color palette (number 1014416).
#' @inheritParams palette_flat
#'
#' @details This function is usually not called directly, but from within
-#' [`scale_color_colorhex()`][scale_color_colorhex].
+#' [`scale_color_colorhex()`][scale_color_colorhex].
#'
#' @export
palette_colorhex <- function(palette = 1014416, reverse = FALSE, ...) {
if (!is.numeric(palette) && suppressWarnings(is.na(as.numeric(palette)))) {
insight::format_error(
- "`palette` must be the numeric code for a color palette at "
+ "`palette` must be the numeric code for a color palette at color-hex.com"
)
}
@@ -205,7 +204,7 @@ palette_colorhex <- function(palette = 1014416, reverse = FALSE, ...) {
} else {
insight::check_if_installed(
"curl",
- reason = "to retrieve palettes from "
+ reason = "to retrieve palettes from color-hex.com"
)
curl_url <- paste0("https://www.color-hex.com//color-palette/", palette)
diff --git a/man/palette_colorhex.Rd b/man/palette_colorhex.Rd
index d140b42b9..366422100 100644
--- a/man/palette_colorhex.Rd
+++ b/man/palette_colorhex.Rd
@@ -2,21 +2,20 @@
% Please edit documentation in R/scale_color_colorhex.R
\name{palette_colorhex}
\alias{palette_colorhex}
-\title{Color palettes from \url{https://www.color-hex.com/}}
+\title{Color palettes from color-hex.com.}
\usage{
palette_colorhex(palette = 1014416, reverse = FALSE, ...)
}
\arguments{
-\item{palette}{The numeric code for a palette at \url{https://www.color-hex.com/}.
-For example, \code{1014416} for the
-\href{https://www.color-hex.com/color-palette/1014416}{Josiah color palette (number 1014416)}.}
+\item{palette}{The numeric code for a palette at color-hex.com. For example,
+\code{1014416} for the Josiah color palette (number 1014416).}
\item{reverse}{Boolean indicating whether the palette should be reversed.}
\item{...}{Additional arguments to pass to \code{\link[=colorRampPalette]{colorRampPalette()}}.}
}
\description{
-This function downloads a requested color palette from \url{https://www.color-hex.com/}.
+This function downloads a requested color palette from color-hex.com.
This website provides a large number of user-submitted color palettes.
}
\details{
@@ -24,7 +23,7 @@ This function is usually not called directly, but from within
\code{\link[=scale_color_colorhex]{scale_color_colorhex()}}.
}
\note{
-The default \href{https://www.color-hex.com/color-palette/1014416}{Josiah color palette (number 1014416)}
-is available without an internet connection. All other color palettes require
-an internet connection to download and access.
+The default Josiah color palette (number 1014416) is available without an
+internet connection. All other color palettes require an internet connection
+to download and access.
}
diff --git a/man/scale_color_colorhex.Rd b/man/scale_color_colorhex.Rd
index 9ee6d5328..2c10aa674 100644
--- a/man/scale_color_colorhex.Rd
+++ b/man/scale_color_colorhex.Rd
@@ -85,9 +85,8 @@ scale_fill_colorhex_c(
)
}
\arguments{
-\item{palette}{The numeric code for a palette at \url{https://www.color-hex.com/}.
-For example, \code{1014416} for the
-\href{https://www.color-hex.com/color-palette/1014416}{Josiah color palette (number 1014416)}.}
+\item{palette}{The numeric code for a palette at color-hex.com. For example,
+\code{1014416} for the Josiah color palette (number 1014416).}
\item{discrete}{Boolean indicating whether color aesthetic is discrete or not.}
diff --git a/tests/testthat/_snaps/check_model_theme/check-model-different-theme-1.svg b/tests/testthat/_snaps/check_model_theme/check-model-different-theme-1.svg
new file mode 100644
index 000000000..275aee63a
--- /dev/null
+++ b/tests/testthat/_snaps/check_model_theme/check-model-different-theme-1.svg
@@ -0,0 +1,551 @@
+
+
diff --git a/tests/testthat/_snaps/check_model_theme/check-model-different-theme-2.svg b/tests/testthat/_snaps/check_model_theme/check-model-different-theme-2.svg
new file mode 100644
index 000000000..62dc742b8
--- /dev/null
+++ b/tests/testthat/_snaps/check_model_theme/check-model-different-theme-2.svg
@@ -0,0 +1,621 @@
+
+
diff --git a/tests/testthat/_snaps/check_model_theme/check-model-theme-attr-2.svg b/tests/testthat/_snaps/check_model_theme/check-model-theme-attr-2.svg
new file mode 100644
index 000000000..b6b2a61d4
--- /dev/null
+++ b/tests/testthat/_snaps/check_model_theme/check-model-theme-attr-2.svg
@@ -0,0 +1,612 @@
+
+
diff --git a/tests/testthat/_snaps/check_model_theme/check-model-theme-attr-3.svg b/tests/testthat/_snaps/check_model_theme/check-model-theme-attr-3.svg
new file mode 100644
index 000000000..9e9d60936
--- /dev/null
+++ b/tests/testthat/_snaps/check_model_theme/check-model-theme-attr-3.svg
@@ -0,0 +1,549 @@
+
+
diff --git a/tests/testthat/_snaps/check_model_theme/check-model-theme-attr.svg b/tests/testthat/_snaps/check_model_theme/check-model-theme-attr.svg
new file mode 100644
index 000000000..a20f5cb1b
--- /dev/null
+++ b/tests/testthat/_snaps/check_model_theme/check-model-theme-attr.svg
@@ -0,0 +1,615 @@
+
+
diff --git a/tests/testthat/_snaps/check_model_theme/check-model-theme-bw-string.svg b/tests/testthat/_snaps/check_model_theme/check-model-theme-bw-string.svg
new file mode 100644
index 000000000..ffcae363e
--- /dev/null
+++ b/tests/testthat/_snaps/check_model_theme/check-model-theme-bw-string.svg
@@ -0,0 +1,618 @@
+
+
diff --git a/tests/testthat/_snaps/check_model_theme/check-model-theme-bw.svg b/tests/testthat/_snaps/check_model_theme/check-model-theme-bw.svg
new file mode 100644
index 000000000..52a35bf36
--- /dev/null
+++ b/tests/testthat/_snaps/check_model_theme/check-model-theme-bw.svg
@@ -0,0 +1,618 @@
+
+
diff --git a/tests/testthat/_snaps/check_model_theme/check-model-theme-custom.svg b/tests/testthat/_snaps/check_model_theme/check-model-theme-custom.svg
new file mode 100644
index 000000000..602265524
--- /dev/null
+++ b/tests/testthat/_snaps/check_model_theme/check-model-theme-custom.svg
@@ -0,0 +1,549 @@
+
+
diff --git a/tests/testthat/_snaps/check_model_theme/check-model-theme-dark-string.svg b/tests/testthat/_snaps/check_model_theme/check-model-theme-dark-string.svg
new file mode 100644
index 000000000..6f1f34072
--- /dev/null
+++ b/tests/testthat/_snaps/check_model_theme/check-model-theme-dark-string.svg
@@ -0,0 +1,612 @@
+
+
diff --git a/tests/testthat/_snaps/check_model_theme/check-model-theme-minimal.svg b/tests/testthat/_snaps/check_model_theme/check-model-theme-minimal.svg
new file mode 100644
index 000000000..4252fc96d
--- /dev/null
+++ b/tests/testthat/_snaps/check_model_theme/check-model-theme-minimal.svg
@@ -0,0 +1,549 @@
+
+
diff --git a/tests/testthat/_snaps/check_model_theme/check-model-without-theme.svg b/tests/testthat/_snaps/check_model_theme/check-model-without-theme.svg
new file mode 100644
index 000000000..11387a546
--- /dev/null
+++ b/tests/testthat/_snaps/check_model_theme/check-model-without-theme.svg
@@ -0,0 +1,569 @@
+
+
diff --git a/tests/testthat/test-check_model_theme.R b/tests/testthat/test-check_model_theme.R
new file mode 100644
index 000000000..ba034531f
--- /dev/null
+++ b/tests/testthat/test-check_model_theme.R
@@ -0,0 +1,195 @@
+skip_on_cran()
+skip_if_not_installed("performance")
+skip_if_not_installed("ggplot2")
+skip_if_not_installed("vdiffr")
+
+expect_doppelganger_with_seed <- function(title, fig, seed = 123) {
+ set.seed(seed)
+ vdiffr::expect_doppelganger(title = title, fig = fig)
+}
+
+# ==============================================================================
+# ISSUE #851: theme argument of performance::check_model() has no effect
+# ==============================================================================
+#
+# These tests document the expected behavior of the theme argument in
+# performance::check_model(). Currently, these tests FAIL due to bugs in the see package's
+# plot.performance::check_model() function.
+#
+# Three main problems identified:
+# 1. Standard ggplot2 themes cause "unused arguments" errors
+# 2. Custom user-defined theme functions cannot be accessed
+# 3. Theme attribute not properly read by see package's plot method
+#
+# The actual fix needs to be implemented in the see package's
+# R/plot.performance::check_model.R file (around lines 64-67).
+#
+# See: https://github.com/easystats/performance/issues/851
+# ==============================================================================
+
+# Test 1: Standard ggplot2 themes should work without errors
+# -----------------------------------------------------------------------------
+# PROBLEM: Currently throws "unused arguments" error because see package passes
+# hardcoded arguments (plot.title.space, axis.title.space, etc.) that don't
+# exist in standard ggplot2 themes.
+test_that("performance::check_model accepts standard ggplot2 themes as functions", {
+ m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
+
+ # Test with theme_dark passed as function (not string)
+ # Explicit namespace call for clarity and to avoid conflicts
+ p1 <- performance::check_model(m, theme = ggplot2::theme_dark())
+ # The plot method should handle the theme attribute correctly
+ expect_doppelganger_with_seed(
+ title = "check_model-theme_attr",
+ fig = plot(p1)
+ )
+
+ # Test with theme_minimal
+ p2 <- performance::check_model(m, theme = ggplot2::theme_minimal())
+ expect_doppelganger_with_seed(
+ title = "check_model-theme_minimal",
+ fig = plot(p2)
+ )
+
+ # Test with theme_bw
+ p3 <- performance::check_model(m, theme = ggplot2::theme_bw())
+ expect_doppelganger_with_seed(
+ title = "check_model-theme_bw",
+ fig = plot(p3)
+ )
+})
+
+
+# Test 2: Theme as string should work for backward compatibility
+# -----------------------------------------------------------------------------
+# PROBLEM: String parsing doesn't work reliably, and when it does parse,
+# it still hits the "unused arguments" error from hardcoded parameters.
+test_that("performance::check_model accepts theme as string (backward compatibility)", {
+ m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
+
+ # String reference should work
+ p1 <- performance::check_model(m, theme = "ggplot2::theme_dark")
+ expect_doppelganger_with_seed(
+ title = "check_model-theme_dark_string",
+ fig = plot(p1)
+ )
+
+ # Test with theme_bw as string
+ p2 <- performance::check_model(m, theme = "ggplot2::theme_bw")
+ expect_doppelganger_with_seed(
+ title = "check_model-theme_bw_string",
+ fig = plot(p2)
+ )
+})
+
+
+# Test 3: Custom theme functions should work
+# -----------------------------------------------------------------------------
+# PROBLEM: Custom themes defined in user environment can't be accessed because
+# the see package's string parsing approach only searches package namespaces.
+test_that("performance::check_model accepts custom theme functions from user environment", {
+ # Define custom theme in test environment
+ my_custom_theme <- function(
+ base_size = 11,
+ base_family = "",
+ base_line_size = base_size / 22,
+ base_rect_size = base_size / 22
+ ) {
+ ggplot2::theme_minimal(
+ base_size = base_size,
+ base_family = base_family,
+ base_line_size = base_line_size,
+ base_rect_size = base_rect_size
+ ) +
+ ggplot2::theme(
+ plot.title = ggplot2::element_text(size = 16, face = "bold"),
+ panel.grid.major = ggplot2::element_line(color = "gray80")
+ )
+ }
+
+ m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
+
+ # Custom theme function should work when passed directly
+ p1 <- performance::check_model(m, theme = my_custom_theme())
+ expect_doppelganger_with_seed(
+ title = "check_model-theme_custom",
+ fig = plot(p1)
+ )
+})
+
+
+# Test 4: Theme attribute should be stored and retrieved correctly
+# -----------------------------------------------------------------------------
+# PROBLEM: The theme attribute is stored by performance::check_model() but may not be
+# properly read by see package's plot method.
+test_that("theme attribute is stored and used correctly", {
+ m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
+
+ # Test with function
+ p1 <- performance::check_model(m, theme = ggplot2::theme_dark())
+
+ # Theme should be stored as attribute
+ expect_true(!is.null(attr(p1, "theme")))
+
+ # Attribute should contain the theme
+ theme_attr <- attr(p1, "theme")
+ expect_s3_class(theme_attr, "theme")
+
+ # Theme should be applied when plotting
+ expect_doppelganger_with_seed(
+ title = "check_model-theme_attr-2",
+ fig = plot(p1)
+ )
+
+ # Test with string
+ p2 <- performance::check_model(m, theme = "ggplot2::theme_minimal")
+ expect_true(!is.null(attr(p2, "theme")))
+ expect_identical(attr(p2, "theme"), "ggplot2::theme_minimal")
+
+ expect_doppelganger_with_seed(
+ title = "check_model-theme_attr-3",
+ fig = plot(p2)
+ )
+})
+
+
+# Test 5: Default theme should work when no theme specified
+# -----------------------------------------------------------------------------
+# Tests that performance::check_model works correctly when no theme argument is provided,
+# ensuring it falls back to the default theme.
+test_that("performance::check_model works without theme argument (default behavior)", {
+ m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
+
+ # Should work with default theme
+ p <- performance::check_model(m)
+ expect_doppelganger_with_seed(
+ title = "check_model-without_theme",
+ fig = plot(p)
+ )
+
+ # Default theme should be stored
+ p <- performance::check_model(m)
+ expect_true(!is.null(attr(p, "theme")))
+})
+
+
+# Test 6: theme argument in plot() should override theme from performance::check_model()
+# -----------------------------------------------------------------------------
+# This tests that the plot method's theme parameter can override the theme
+# set during performance::check_model() call.
+test_that("plot theme argument overrides performance::check_model theme", {
+ m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
+
+ # Create with one theme
+ p <- performance::check_model(m, theme = ggplot2::theme_dark())
+
+ # Plot with different theme - should work
+ expect_doppelganger_with_seed(
+ title = "check_model-different_theme-1",
+ fig = plot(p, theme = ggplot2::theme_minimal())
+ )
+ expect_doppelganger_with_seed(
+ title = "check_model-different_theme-2",
+ fig = plot(p, theme = ggplot2::theme_bw())
+ )
+})
diff --git a/tests/testthat/test-plot.check_normality.R b/tests/testthat/test-plot.check_normality.R
index cd14a9979..968a05620 100644
--- a/tests/testthat/test-plot.check_normality.R
+++ b/tests/testthat/test-plot.check_normality.R
@@ -1,3 +1,5 @@
+skip_if_not_installed("vdiffr")
+
test_that("`plot.see_check_normality()` works", {
skip_if_not_installed("lme4")
skip_if_not_installed("qqplotr")
diff --git a/tests/testthat/test-plot.check_outliers.R b/tests/testthat/test-plot.check_outliers.R
index f1c286a47..d365dd32e 100644
--- a/tests/testthat/test-plot.check_outliers.R
+++ b/tests/testthat/test-plot.check_outliers.R
@@ -1,3 +1,5 @@
+skip_if_not_installed("vdiffr")
+
test_that("`plot.see_check_outliers()` works", {
mt1 <- mtcars[, c(1, 3, 4)]
mt2 <- rbind(
diff --git a/tests/testthat/test-plot.compare_parameters.R b/tests/testthat/test-plot.compare_parameters.R
index 4819df434..4576d600b 100644
--- a/tests/testthat/test-plot.compare_parameters.R
+++ b/tests/testthat/test-plot.compare_parameters.R
@@ -2,6 +2,8 @@ test_that("`plot()` for compare_parameters", {
skip_if_not_installed("glmmTMB")
skip_if_not_installed("lme4")
skip_if_not_installed("parameters")
+ skip_if_not_installed("vdiffr")
+
gdat <- readRDS(system.file(
"vignette_data",
"gophertortoise.rds",
diff --git a/tests/testthat/test-plot.effectsize_table.R b/tests/testthat/test-plot.effectsize_table.R
index bbb6b490c..5747ed034 100644
--- a/tests/testthat/test-plot.effectsize_table.R
+++ b/tests/testthat/test-plot.effectsize_table.R
@@ -1,4 +1,5 @@
test_that("`plot.see_effectsize_table()` works", {
+ skip_if_not_installed("vdiffr")
m <- aov(mpg ~ factor(am) * factor(cyl), data = mtcars)
result <- effectsize::eta_squared(m)
set.seed(123)
diff --git a/tests/testthat/test-plot.n_factors.R b/tests/testthat/test-plot.n_factors.R
index 529ed0c11..9b2fcd403 100644
--- a/tests/testthat/test-plot.n_factors.R
+++ b/tests/testthat/test-plot.n_factors.R
@@ -1,5 +1,6 @@
test_that("`plot.see_n_factors()` works", {
skip_if_not_installed("nFactors")
+ skip_if_not_installed("vdiffr")
result <- parameters::n_factors(datasets::mtcars, type = "PCA")
diff --git a/tests/testthat/test-plot.p_direction.R b/tests/testthat/test-plot.p_direction.R
index 22a997f46..68e5db3af 100644
--- a/tests/testthat/test-plot.p_direction.R
+++ b/tests/testthat/test-plot.p_direction.R
@@ -1,3 +1,5 @@
+skip_if_not_installed("vdiffr")
+
test_that("`plot.see_p_direction()` works", {
skip_if_not_installed("rstanarm")
skip_if_not_installed("ggridges")
diff --git a/tests/testthat/test-plot.p_significance.R b/tests/testthat/test-plot.p_significance.R
index 3fd485f78..e7446f8fe 100644
--- a/tests/testthat/test-plot.p_significance.R
+++ b/tests/testthat/test-plot.p_significance.R
@@ -1,3 +1,5 @@
+skip_if_not_installed("vdiffr")
+
test_that("`plot.see_p_significance()` works", {
skip_if_not_installed("rstanarm")
skip_if_not_installed("ggridges")
@@ -9,8 +11,8 @@ test_that("`plot.see_p_significance()` works", {
})
skip_on_cran()
-skip_if_not_installed("bayestestR", minimum_version = "0.14.1")
-skip_if_not_installed("parameters", minimum_version = "0.22.3")
+skip_if_not_installed("bayestestR")
+skip_if_not_installed("parameters")
test_that("`plot.see_p_significance works for two thresholds", {
skip_if_not_installed("ggridges")
diff --git a/tests/testthat/test-plot.parameters_model.R b/tests/testthat/test-plot.parameters_model.R
index a3784f628..17d4ba9bf 100644
--- a/tests/testthat/test-plot.parameters_model.R
+++ b/tests/testthat/test-plot.parameters_model.R
@@ -1,3 +1,5 @@
+skip_if_not_installed("vdiffr")
+
test_that("`plot.see_parameters_model()` works", {
m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
result <- parameters::model_parameters(m)
@@ -20,11 +22,11 @@ test_that("`plot.see_parameters_model()` sort parameter works for fixed effects"
# Test sort = TRUE (should be same as ascending)
p1 <- plot(result, sort = TRUE)
expect_s3_class(p1, "gg")
-
+
# Test sort = "ascending"
p2 <- plot(result, sort = "ascending")
expect_s3_class(p2, "gg")
-
+
# Test sort = "descending"
p3 <- plot(result, sort = "descending")
expect_s3_class(p3, "gg")
diff --git a/tests/testthat/test-plot.performance_pp_check.R b/tests/testthat/test-plot.performance_pp_check.R
index 0fd19703e..c98258ba6 100644
--- a/tests/testthat/test-plot.performance_pp_check.R
+++ b/tests/testthat/test-plot.performance_pp_check.R
@@ -1,3 +1,5 @@
+skip_if_not_installed("vdiffr")
+
test_that("`print.see_performance_pp_check()` works", {
set.seed(123)
model <- lm(Sepal.Length ~ Species * Petal.Width + Petal.Length, data = iris)
diff --git a/tests/testthat/test-plot.performance_roc.R b/tests/testthat/test-plot.performance_roc.R
index 3451c4781..dab3d4e52 100644
--- a/tests/testthat/test-plot.performance_roc.R
+++ b/tests/testthat/test-plot.performance_roc.R
@@ -1,4 +1,5 @@
test_that("`plot.see_performance_roc()` works", {
+ skip_if_not_installed("vdiffr")
set.seed(123)
iris$y <- rbinom(nrow(iris), size = 1, 0.3)
folds <- sample(nrow(iris), size = nrow(iris) / 8, replace = FALSE)
diff --git a/tests/testthat/test-plot.simulate_parameters.R b/tests/testthat/test-plot.simulate_parameters.R
index 320ec7f3f..657ba533d 100644
--- a/tests/testthat/test-plot.simulate_parameters.R
+++ b/tests/testthat/test-plot.simulate_parameters.R
@@ -4,7 +4,7 @@ skip_on_cran()
skip_if_offline()
skip_if_not_installed("mclogit")
skip_if_not_installed("parameters")
-
+skip_if_not_installed("vdiffr")
test_that("`plot()` for simulate_parameters", {
pict <- base::readRDS(url("https://slcladal.github.io/data/pict.rda", "rb"))
diff --git a/tests/testthat/test-scale_color_colorhex_c.R b/tests/testthat/test-scale_color_colorhex_c.R
index 81629f7e3..d96021648 100644
--- a/tests/testthat/test-scale_color_colorhex_c.R
+++ b/tests/testthat/test-scale_color_colorhex_c.R
@@ -1,4 +1,5 @@
test_that("scale_fill_colorhex works as expected", {
+ skip_if_not_installed("vdiffr")
set.seed(123)
vdiffr::expect_doppelganger(
title = "scale_fill_colorhex_d works",
diff --git a/tests/testthat/test-vdiffr_bayestestr_plots.R b/tests/testthat/test-vdiffr_bayestestr_plots.R
index cbe5501de..3df9a5e4a 100644
--- a/tests/testthat/test-vdiffr_bayestestr_plots.R
+++ b/tests/testthat/test-vdiffr_bayestestr_plots.R
@@ -1,5 +1,6 @@
test_that("bayestestR package plots rendered correctly", {
# plot.see_bayesfactor_models() --------------------
+ skip_if_not_installed("vdiffr")
lm0 <- stats::lm(qsec ~ 1, data = mtcars)
lm1 <- stats::lm(qsec ~ drat, data = mtcars)
diff --git a/tests/testthat/test-vdiffr_check_model.R b/tests/testthat/test-vdiffr_check_model.R
index 55831119d..6612bff91 100644
--- a/tests/testthat/test-vdiffr_check_model.R
+++ b/tests/testthat/test-vdiffr_check_model.R
@@ -1,4 +1,6 @@
skip_on_cran()
+skip_if_not_installed("vdiffr")
+skip_if_not_installed("performance")
# Snapshot tests for check_model() plots
# These tests verify that diagnostic plots render consistently across versions.
@@ -11,10 +13,6 @@ expect_doppelganger_with_seed <- function(title, fig, seed = 123) {
}
test_that("plot.see_check_model() renders correctly", {
- skip_if_not_installed("performance")
- skip_if_not_installed("see")
- skip_on_cran()
-
set.seed(123)
model <- lm(mpg ~ wt + hp + cyl, data = mtcars)
@@ -51,10 +49,6 @@ test_that("plot.see_check_model() renders correctly", {
test_that("plot.see_check_model() works with themes", {
- skip_if_not_installed("performance")
- skip_if_not_installed("see")
- skip_on_cran()
-
set.seed(123)
data(mtcars)
model <- lm(mpg ~ wt + hp, data = mtcars)
@@ -82,10 +76,6 @@ test_that("plot.see_check_model() works with themes", {
test_that("plot.see_check_model() works with custom colors", {
- skip_if_not_installed("performance")
- skip_if_not_installed("see")
- skip_on_cran()
-
set.seed(123)
model <- lm(mpg ~ wt + hp, data = mtcars)
@@ -101,10 +91,6 @@ test_that("plot.see_check_model() works with custom colors", {
test_that("plot.see_check_normality() renders correctly", {
- skip_if_not_installed("performance")
- skip_if_not_installed("see")
- skip_on_cran()
-
set.seed(123)
model <- lm(mpg ~ wt + hp + cyl, data = mtcars)
norm_result <- performance::check_normality(model)
@@ -122,10 +108,6 @@ test_that("plot.see_check_normality() renders correctly", {
test_that("plot.see_check_homogeneity() renders correctly", {
- skip_if_not_installed("performance")
- skip_if_not_installed("see")
- skip_on_cran()
-
set.seed(123)
model <- lm(mpg ~ wt, data = mtcars)
@@ -145,10 +127,6 @@ test_that("plot.see_check_homogeneity() renders correctly", {
test_that("plot.see_check_outliers() renders correctly", {
- skip_if_not_installed("performance")
- skip_if_not_installed("see")
- skip_on_cran()
-
set.seed(123)
model <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
@@ -168,10 +146,6 @@ test_that("plot.see_check_outliers() renders correctly", {
test_that("plot.see_check_model() handles large datasets efficiently", {
- skip_if_not_installed("performance")
- skip_if_not_installed("see")
- skip_on_cran()
-
# Test that sampling produces consistent plots with larger datasets
set.seed(123)
large_data <- data.frame(
@@ -196,10 +170,6 @@ test_that("plot.see_check_model() handles large datasets efficiently", {
test_that("plot.see_check_model() works with show_dots parameter", {
- skip_if_not_installed("performance")
- skip_if_not_installed("see")
- skip_on_cran()
-
set.seed(123)
model <- lm(mpg ~ wt + hp, data = mtcars)
@@ -226,10 +196,6 @@ test_that("plot.see_check_model() works with show_dots parameter", {
test_that("plot outliers skips smooth for low N", {
- skip_if_not_installed("performance")
- skip_if_not_installed("see")
- skip_on_cran()
-
# fmt: skip
sdata <- data.frame(
TrtLin = factor(rep(
@@ -265,7 +231,6 @@ test_that("plot outliers skips smooth for low N", {
test_that("ppc_range works", {
skip_if_not_installed("MASS")
- skip_if_not_installed("performance")
set.seed(3)
mu <- rpois(500, lambda = 3)
x <- pmax(ceiling(rnorm(500, mu, mu * 3)), 0)
diff --git a/tests/testthat/test-vdiffr_check_overdispersion.R b/tests/testthat/test-vdiffr_check_overdispersion.R
index 3ce04c22e..1c6c87c35 100644
--- a/tests/testthat/test-vdiffr_check_overdispersion.R
+++ b/tests/testthat/test-vdiffr_check_overdispersion.R
@@ -1,4 +1,5 @@
skip_on_cran()
+skip_if_not_installed("vdiffr")
# Snapshot tests for check_model() plots
# These tests verify that diagnostic plots render consistently across versions.
@@ -11,9 +12,9 @@ expect_doppelganger_with_seed <- function(title, fig, seed = 123) {
}
test_that("plot.see_check_model() renders correctly", {
- skip_if_not_installed("performance", minimum_version = "0.17.0.2")
- skip_if_not_installed("see")
+ skip_if_not_installed("performance")
skip_if_not_installed("DHARMa")
+ skip_if_not_installed("glmmTMB")
set.seed(123)
diff --git a/tests/testthat/test-vdiffr_check_predictions.R b/tests/testthat/test-vdiffr_check_predictions.R
index 17aaaf4f9..28d713d4f 100644
--- a/tests/testthat/test-vdiffr_check_predictions.R
+++ b/tests/testthat/test-vdiffr_check_predictions.R
@@ -1,4 +1,5 @@
skip_on_cran()
+skip_if_not_installed("vdiffr")
# Snapshot tests for check_model() plots
# These tests verify that diagnostic plots render consistently across versions.
@@ -12,8 +13,6 @@ expect_doppelganger_with_seed <- function(title, fig, seed = 123) {
test_that("plot.see_check_predictions() renders correctly", {
skip_if_not_installed("performance")
- skip_if_not_installed("see")
- skip_on_cran()
data(mtcars)
model <- lm(mpg ~ disp, data = mtcars)
@@ -32,7 +31,7 @@ test_that("plot.see_check_predictions() renders correctly", {
test_that("check_predicions - type and x_limits arguments work", {
skip_if_not_installed("MASS")
- skip_if_not_installed("performance", minimum_version = "0.17.0.3")
+ skip_if_not_installed("performance")
set.seed(3)
mu <- rpois(500, lambda = 3)
x <- pmax(ceiling(rnorm(500, mu, mu * 3)), 0)
diff --git a/tests/testthat/test-vdiffr_check_priors.R b/tests/testthat/test-vdiffr_check_priors.R
index 5d7091f58..284952d83 100644
--- a/tests/testthat/test-vdiffr_check_priors.R
+++ b/tests/testthat/test-vdiffr_check_priors.R
@@ -1,4 +1,5 @@
skip_on_cran()
+skip_if_not_installed("vdiffr")
# Helper function for reproducible vdiffr tests
expect_doppelganger_with_seed <- function(title, fig, seed = 123) {
diff --git a/tests/testthat/test-vdiffr_geoms_coords.R b/tests/testthat/test-vdiffr_geoms_coords.R
index d7cabfa1e..11a5e90f4 100644
--- a/tests/testthat/test-vdiffr_geoms_coords.R
+++ b/tests/testthat/test-vdiffr_geoms_coords.R
@@ -1,3 +1,5 @@
+skip_if_not_installed("vdiffr")
+
test_that("geom and coord functions work correctly", {
skip_if_not_installed("ggplot2")
# coord_radar() ------------------
diff --git a/tests/testthat/test-vdiffr_means_by_group.R b/tests/testthat/test-vdiffr_means_by_group.R
index c39410a9c..9da6dfe78 100644
--- a/tests/testthat/test-vdiffr_means_by_group.R
+++ b/tests/testthat/test-vdiffr_means_by_group.R
@@ -1,3 +1,6 @@
+skip_on_cran()
+skip_if_not_installed("vdiffr")
+
test_that("datawizard means_by_group rendered correctly", {
set.seed(123)
vdiffr::expect_doppelganger(
diff --git a/tests/testthat/test-vdiffr_scale_color.R b/tests/testthat/test-vdiffr_scale_color.R
index 38d7a6ccc..239dd0296 100644
--- a/tests/testthat/test-vdiffr_scale_color.R
+++ b/tests/testthat/test-vdiffr_scale_color.R
@@ -1,3 +1,5 @@
+skip_if_not_installed("vdiffr")
+
test_that("scale_color_ functions work correctly", {
vdiffr::expect_doppelganger(
title = "scale_color_bluebrown_d() works",