Learn R Programming

camtrapR (version 2.2.0)

plot_effects,commOccu-method: 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 commOccu
plot_effects(
  object,
  mcmc.list,
  submodel = "state",
  draws = 1000,
  outdir,
  level = 0.95,
  keyword_squared = "_squared",
  ...
)

Arguments

object

commOccu object

mcmc.list

mcmc.list. Output of fit called on a commOccu object

submodel

Submodel to get plots for. Can be "det" or "state"

draws

Number of draws from the posterior to use when generating the plots. If fewer than draws are available, they are all used

outdir

Directory to save plots to (optional)

level

Probability mass to include in the uncertainty interval

keyword_squared

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.

...

additional arguments for ggsave

Value

list of ggplot objects