plot.scampr: Plot diagnositcs for objects of class 'scampr' ### WIP ###

View source: R/plot.scampr.R

plot.scamprR Documentation

Plot diagnositcs for objects of class 'scampr' ### WIP ###

Description

Currently plots residuals as in 'spatstat', as well as the fitted intensity, over the quadrature used to model the point pattern. In the case of presence/absence data fitted vs. residuals is plotted.

Usage

## S3 method for class 'scampr'
plot(x, ..., which = c("residuals", "fitted"), add.points = F)

Arguments

x

a scampr model object

...

additional plotting arguments

which

if a subset of the plots is required, specify one of 'residuals' or 'fitted': plots Pearson residuals and fitted intensity respectively for PPM (for a PA data model: plots fitted vs. raw residuals and the survey data for 'residuals' and 'fitted' resp.).

add.points

logical indicating whether to add the presence point locations to plots

Value

See spatstat::plot.ppm

Examples

# Get the flora data for one of the species
dat_po <- flora$po$sp1
dat_pa <- flora$pa

# Attach the quadrature to the PO data
dat_po <- rbind.data.frame(dat_po, flora$quad)

# Fit an IPP model to the point pattern
m.ipp <- scampr(pres ~ MNT + D.Main, data = dat_po, model.type = "ipp")

# Fit a combined data model
m.comb <- scampr(pres ~ MNT + D.Main, dat_po, sp1 ~ MNT,
dat_pa, model.type = "ipp")

# Fit presence/absence model
m.pa <- scampr(pa.formula = sp1 ~ MNT, pa.data = dat_pa, model.type = "ipp")

plot(m.ipp)
plot(m.comb)
plot(m.pa)

ElliotDovers/scampr documentation built on March 17, 2024, 3:27 p.m.