Skip to content

Commit

Permalink
lintr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 27, 2023
1 parent 5b96362 commit ddc4d6b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/check_residuals.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}
}

Expand Down

0 comments on commit ddc4d6b

Please sign in to comment.