Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Mar 15, 2024
1 parent 0533558 commit 87d9036
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ S3method(plot,check_model)
S3method(plot,check_normality)
S3method(plot,check_outliers)
S3method(plot,check_overdisp)
S3method(plot,check_residuals)
S3method(plot,check_sphericity)
S3method(plot,compare_performance)
S3method(plot,performance_pp_check)
Expand Down
8 changes: 7 additions & 1 deletion R/check_residuals.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' [`DHARMa::simulateResiduals()`].
#' @param alternative A character string specifying the alternative hypothesis.
#' See [`stats::ks.test()`] for details.
#' @param ... Passed down to [`stats::ks.test()`]
#' @param ... Passed down to [`stats::ks.test()`].
#'
#' @details Uniformity of residuals is checked using a Kolmogorov-Smirnov test.
#'
Expand Down Expand Up @@ -85,3 +85,9 @@ print.check_residuals <- function(x, ...) {

invisible(x)
}

#' @export
plot.check_residuals <- function(x, ...) {
insight::check_if_installed("see", "for residual plots")
NextMethod()
}
12 changes: 9 additions & 3 deletions R/simulate_residuals.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
#' @title Simulate randomized quantile residuals from a model
#' @name simulate_residuals
#'
#' @description to do.
#' @description Returns simulated residuals from a model. This is useful for
#' checking the uniformity of residuals, in particular for non-Gaussian models,
#' where the residuals are not expected to be normally distributed.
#'
#' @param x A model object.
#' @param iterations Number of simulations to run.
#' @param ... Arguments passed on to [`DHARMa::simulateResiduals()`].
#'
#' @return Simulated residuals, which can be further processed with
#' [`check_residuals()`].
#' [`check_residuals()`]. The returned object is of class `DHARMa` and
#' `performance_simres`.
#'
#' @seealso [`check_residuals()`]
#'
#' @details Based on [`DHARMa::simulateResiduals()`]. See also `vignette("DHARMa")`.
#' @details This function is a small wrapper around [`DHARMa::simulateResiduals()`].
#' It basically only sets `plot = FALSE` and adds an additional class attribute
#' (`"performance_sim_res"`), which allows using the DHARMa object in own plotting
#' functions in the **see** package. See also `vignette("DHARMa")`.
#'
#' @references
#'
Expand Down
2 changes: 1 addition & 1 deletion man/check_residuals.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions man/simulate_residuals.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 87d9036

Please sign in to comment.