Learn R Programming

camtrapR (version 2.2.0)

predict,commOccu-method: Spatial predictions from community occupancy models

Description

Create spatial predictions of species occupancy and species richness from community occupancy models and raster stacks.

Usage

# S4 method for commOccu
predict(
  object,
  mcmc.list,
  type,
  draws = 1000,
  level = 0.95,
  interval = c("none", "confidence"),
  x,
  speciesSubset
)

Arguments

object

commOccu object

mcmc.list

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

type

character. "psi" for species occupancy estimates, "richness" for species richness estimates

draws

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

level

Probability mass to include in the uncertainty interval

interval

# Type of interval calculation. Can be "none" or "confidence". Can be slow for type = "psi" with many cells and posterior samples. Can be abbreviated.

x

raster stack or data.frame. Must be scaled with same parameters as site covariates used in model, and have same names.

speciesSubset

species to include in richness estimates. Can be index number or species names.

Value

A raster stack or data.frame, depending on x