Skip to content

Commit

Permalink
fix vignette issues
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 27, 2023
1 parent a6a5afe commit 5b96362
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions vignettes/simulate_residuals.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,29 @@ editor_options:
chunk_output_type: console
---

```{r}
devtools::load_all()
library(DHARMa)
```{r , include=FALSE}
library(knitr)
library(performance)
options(knitr.kable.NA = "")
knitr::opts_chunk$set(
comment = ">",
message = FALSE,
warning = FALSE,
out.width = "100%",
dpi = 450
)
options(digits = 2)
pkgs <- c("DHARMa", "glmmTMB")
successfully_loaded <- vapply(pkgs, requireNamespace, FUN.VALUE = logical(1L), quietly = TRUE)
can_evaluate <- all(successfully_loaded)
if (can_evaluate) {
knitr::opts_chunk$set(eval = TRUE)
vapply(pkgs, require, FUN.VALUE = logical(1L), quietly = TRUE, character.only = TRUE)
} else {
knitr::opts_chunk$set(eval = FALSE)
}
```

The basic workflow for simulated residual checks using `simulate_residuals()` is as follows.
Expand Down Expand Up @@ -45,6 +65,7 @@ simulated_residuals
Note that since this inherits the DHARMa class, all the methods implemented in DHARMa just work, including all the tests:

```{r}
library(DHARMa)
residuals(simulated_residuals)
DHARMa::testUniformity(simulated_residuals, plot = FALSE)
Expand Down

0 comments on commit 5b96362

Please sign in to comment.