plot_effects,commOccu-method {camtrapR} | R Documentation |
Plot Marginal Effects of Covariates
Description
Plot marginal effect plots (= response curves if covariates are continuous) for all species in a community (multi-species) occupancy model. Takes into account species-specific intercepts (if any). Currently only supports continuous covariates, not categorical covariates.
Usage
## S4 method for signature 'commOccu'
plot_effects(
object,
mcmc.list,
submodel = "state",
response = "occupancy",
draws = 1000,
outdir,
level = 0.95,
keyword_quadratic = "_squared",
...
)
Arguments
object |
|
mcmc.list |
mcmc.list. Output of |
submodel |
character. Submodel to get plots for. Can be |
response |
character. response type on y axis. Only relevant for |
draws |
integer. Number of draws from the posterior to use when generating the plots. If fewer posterior samples than specified in |
outdir |
character. Directory to save plots to (optional) |
level |
numeric. Probability mass to include in the uncertainty interval. |
keyword_quadratic |
character. A suffix in covariate names in the model that indicates a covariate is a quadratic effect of another covariate which does not carry the suffix in its name (e.g. if the covariate is "elevation", the quadratic covariate would be "elevation_squared"). |
... |
additional arguments for |
Details
Users who wish to create their own visualizations can use the data stored in the ggplot output. It is accessed via e.g. output$covariate_name$data
Value
A list of ggplot objects (one list item per covariate).