Plot temporal detection rates
plot_surveys.RdPlots species-level temporal detection rates combining survey predictors (if
included via make_data()) and survey random effects (kappa).
Usage
plot_surveys(
fit,
species = NULL,
surveys = NULL,
intercepts = TRUE,
back_transform = TRUE,
include_predictors = TRUE,
restricted = TRUE,
ndraws = NULL,
seed = NULL,
palette = "YlGn",
...
)Arguments
- fit
A fitted model object from
fit_model().- species
character. Vector of species to plot. IfNULL(default), all species are plotted. Must be one ofattr(occARU_data, "species").- surveys
character. Vector of survey dates to plot. IfNULL(default), all surveys are plotted. Must be one ofattr(occARU_data, "surveys").- intercepts
logical. IfTRUE(default), species-level baseline log detection rates are added to the survey effects. IfFALSE, only the temporal deviations are plotted on the log scale.- back_transform
logical. Only used whenintercepts = TRUE. IfTRUE(default), log detection rates are back-transformed to the natural scale viaexp(). IfFALSE, values are left on the log scale.- include_predictors
logical. IfTRUE(default), includes predictors in the survey effects, if included. IfFALSE, only plots the random effects.- restricted
logical. IfTRUE(default), wheninclude_predictorsisFALSEand the model was fit withproject_kappa = TRUE, plots random survey effects with orthogonal projection, i.e., \(\boldsymbol{\kappa}(\boldsymbol{I} - \boldsymbol{P_{X_3}})\), where \(\boldsymbol{I} - \boldsymbol{P_{X_3}}\) is the orthogonal complement of the column space of the site-averaged survey design matrix. IfFALSE, plots random effects without orthogonal projection, i.e., \(\boldsymbol{\kappa}\) only. Has no effect wheninclude_predictorsisTRUEas the linear predictor is unaffected by orthogonal projection.- ndraws
Positive integer. Number of draws to use for plotting, passed to
tidybayes::spread_rvars(). Default:NULL(uses all draws).- seed
Positive numeric. Seed to use when subsampling draws when
ndrawsis notNULL. Default: random integer.- palette
character. Colour palette to be passed toggplot2::scale_fill_brewer(). Default:"YlGn".- ...
Additional arguments passed to
ggdist::stat_lineribbon()such as.widthandpoint_interval.