plot_MLM3 | R Documentation |
plot_MLM3
plots the trait-environment interaction
of a fitted MLM3 object.
plot_MLM3( MLM3, verbose = FALSE, title = paste("site and species effects (fixed + random) against env and trait") )
MLM3 |
the fitted MLM3 object, created by glmer (lme4) or glmmTMB. |
verbose |
logical; default FALSE. If TRUE, a summary of the MLM3 object is printed. |
title |
character text to adapt the main title. |
The code uses libraries ggplot2 and dplyr. The trait and environment variable names in the MLM3 model must be 'trait' and 'env' as in the example (as they are hard coded)
A list of printable and modifiable objects of class ggplot2.
ter Braak (2019) New robust weighted averaging- and model-based methods for assessing trait-environment relationships. Methods in Ecology and Evolution (https://doi.org/10.1111/2041-210X.13278)
expand4glmm
.
## Not run: data("Revisit") formula.MLM3 <- y ~ env*trait + (1 + env|species) + (1 + trait| site) MLM3 <- glmmTMB(formula.MLM3, family = betabinomial, data=Revisit) plot_MLM3(MLM3) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.