Skip to content

Commit

Permalink
only run certain chunks if devel version available
Browse files Browse the repository at this point in the history
  • Loading branch information
zeileis committed Oct 18, 2024
1 parent fa64768 commit ab94567
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions vignettes/quantiles.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ vignette: >
---

```{r preliminaries, echo=FALSE, message=FALSE, results="hide"}
pkg_installer <- get("install.packages")
if(!("gamlss.ggplots" %in% installed.packages()) || packageVersion("gamlss.ggplots") < "2.1-15") {
pkg_installer("gamlss.ggplots", repos = "https://gamlss-dev.R-universe.dev")
install.packages("gamlss.ggplots", repos = "https://gamlss-dev.R-universe.dev")
}
if(packageVersion("gamlss.dist") < "6.1-3") {
pkg_installer("gamlss.dist", repos = "https://gamlss-dev.R-universe.dev")
install.packages("gamlss.dist", repos = "https://gamlss-dev.R-universe.dev")
}
dev_version <- packageVersion("gamlss.ggplots") >= "2.1-15" && packageVersion("gamlss.dist") >= "6.1-3"
library("gamlss2")
```

Expand Down Expand Up @@ -136,12 +137,14 @@ Our preferred approach is to use the `resid_wp()` function from the `gamlss.ggpl
as it provides additional useful information.

```{r}
#| eval: !expr 'dev_version'
#| message: false
library("gamlss.ggplots")
resid_wp(m3)
```
The function `model_wp()` can be use for multiple model worm plots.
```{r}
#| eval: !expr 'dev_version'
#| message: false
model_wp(m1, m2, m3)
```
Expand All @@ -151,6 +154,7 @@ into different age ranges, which is useful for detecting model inadequacies acro
age groups. Here' s how you can use the `model_wp_wrap()` function:

```{r}
#| eval: !expr 'dev_version'
#| message: false
model_wp_wrap(m1,m2,m3,xvar=dbbmi$age)
```
Expand Down Expand Up @@ -187,6 +191,7 @@ A more elegant plot can be generated using the `fitted_centiles()` or `fitted_ce
functions from the `gamlss.ggplots` package. For example:

```{r}
#| eval: !expr 'dev_version'
#| warning: false
fitted_centiles_legend(m3, cent= c(2, 10, 25, 50, 75, 90, 98))
```
Expand Down

0 comments on commit ab94567

Please sign in to comment.