image.scampr: Plot the image of a field over a model quadrature ### WIP ###

View source: R/image.scampr.R

image.scamprR Documentation

Plot the image of a field over a model quadrature ### WIP ###

Description

An image plotting function that uses fields::image.plot() to display the specified variable as a field over the quadrature.

Usage

## S3 method for class 'scampr'
image(x, z, domain.data, residual.type, residual.smoothing = 0.5, ...)

Arguments

x

a scampr model object

z

Either a single characater string of the variable name (in the model data) or one of 'fitted', 'residuals'. Alternatively, a vector of numeric values to be plotted

domain.data

a data frame containing (at least) the horizontal and vertical coordinates as used in the model 'x' as well as the variable name of 'z' if specified. If missing, the quadrature points of the model will be used.

residual.type

an optional character string for residual type if z == 'residual'

residual.smoothing

an optional numeric for the scale of residual smoothing (theta in fields::image.smooth())

...

additional plotting arguments

Value

See fields::image.plot()

Examples

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

# Attach the quadrature points to the presence-only data
dat_po <- rbind.data.frame(dat_po, flora$quad) # using full quadrature for plotting

# Ensure the "response" variable in each data set shares the same name
dat_po$presence <- dat_po$pres
dat_pa$presence <- dat_pa$sp1

# Integrated Data Model
idm <- scampr(presence ~ MNT, dat_po, bias.formula = ~ D.Main,
pa.data = dat_pa, include.sre = F, model.type = "IDM", latent.po.biasing = F)

image(idm, "fitted")
## Not run: 
image(idm, "MNT")
image(idm, "residuals")

## End(Not run)

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