show.Dsurf: Plotting an estimated density surface.

View source: R/surveyplots.r

show.DsurfR Documentation

Plotting an estimated density surface.

Description

Plots density surface estimated by a model fitted with the function fit.ascr.

Usage

show.Dsurf(
  fit,
  session = 1,
  newdata = NULL,
  show.cv = FALSE,
  unsuitable = NULL,
  xlim = NULL,
  ylim = NULL,
  zlim = NULL,
  scale = 1,
  plot.contours = TRUE,
  add = FALSE
)

Arguments

fit

A fitted model from fit.ascr.

session

The session with the detector array and invidual(s) to be plotted. Ignored if the newdata argument is provided.

newdata

A data frame including new mask points and covariate values, from which to estimate and plot density estimates for. This allows, for example, estimates to be provided for new regions not included in the mask used to fit the model. Two columns, named x and y, must be included, providing the x- and y-coordinates of the new mask points. Additional columns must provide the covariates used to fit the model.

show.cv

Logical. If true, the CV of the density estimate is plotted rather than the estimate itself. At present, this will only work if newdata is also provided.

unsuitable

A data frame with two columns, named x and y, providing mask points in unsuitable habitat. These mask points are allocated a density of zero in the plot.

xlim

A numeric vector of length 2, giving the x coordinate range.

ylim

A numeric vector of length 2, giving the y coordinate range.

zlim

A numberic vector of length 2, giving the range of density contours.

scale

By default, density is in animals per hectare. The plotted values are multiplied by this argument, allowing for user-specified units. For example, setting scale = 100 results in densities plotted as animals per square kilometre.

plot.contours

Logical, if TRUE, contours are plotted.

add

Logical, if TRUE, contours will be added to an existing plot.

Examples

simple.capt <- example.data$capt[1]
cov.df <- data.frame(x = example.data$mask[, 1]/1000, y = example.data$mask[, 2]/1000)
fit <- fit.ascr(capt = simple.capt, traps = example.data$traps, mask = example.data$mask,
                fix = list(g0 = 1), ihd.opts = list(model = ~ x + y,
                                                    covariates = cov.df))
show.Dsurf(fit)

b-steve/ascr documentation built on Aug. 15, 2022, 2:38 p.m.