diff --git a/vignettes/quantiles.qmd b/vignettes/quantiles.qmd index 59a4a12..9a1e63d 100644 --- a/vignettes/quantiles.qmd +++ b/vignettes/quantiles.qmd @@ -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") ``` @@ -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) ``` @@ -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) ``` @@ -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)) ```