From ddc4d6b61b8b4e2b6ee1e9f30e48c183bb63dbba Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 27 Oct 2023 09:44:38 +0200 Subject: [PATCH] lintr --- R/check_residuals.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/check_residuals.R b/R/check_residuals.R index e5b649307..26f8a614a 100644 --- a/R/check_residuals.R +++ b/R/check_residuals.R @@ -7,13 +7,14 @@ #' #' @export check_residuals <- function(x, ...) { + insight::check_if_installed("DHARMa") # TODO: This should be an S3 method instead of using ifelse - if (any(class(x) %in% c("performance_simres", "DHARMa"))) { + if (inherits(x, c("performance_simres", "DHARMa"))) { # tests if the overall distribution conforms to expectations; equivalent to: # ks.test(residuals(simulated_residuals), "punif") DHARMa::testUniformity(x, plot = FALSE, ...) } else { - stop("Unsupported input") + insight::format_error("Unsupported input.") } }