Skip to content

Commit

Permalink
add plot method
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 30, 2023
1 parent 5b439d7 commit bd737f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ S3method(plot,check_sphericity)
S3method(plot,compare_performance)
S3method(plot,performance_pp_check)
S3method(plot,performance_roc)
S3method(plot,performance_simres)
S3method(plot,test_likelihoodratio)
S3method(plot,test_performance)
S3method(print,binned_residuals)
Expand Down
8 changes: 7 additions & 1 deletion R/simulate_residuals.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ simulate_residuals <- function(x, iterations = 250, ...) {
# in it that we'll want to pass onto other functions later, such as passing
# the fitted model into check_model().
out <- DHARMa::simulateResiduals(x, n = iterations, plot = FALSE, ...)
class(out) <- c("performance_simres", class(out))
class(out) <- c("performance_simres", "see_performance_simres", class(out))
out
}

Expand All @@ -59,3 +59,9 @@ print.performance_simres <- function(x, ...) {
)
cat(insight::format_message(msg))
}

#' @export
plot.performance_simres <- function(x, ...) {
insight::check_if_installed("see", "for residual plots")
NextMethod()
}

0 comments on commit bd737f1

Please sign in to comment.