kfunc_envelopes: Perform simulations from a scampr model to calculate global...

View source: R/kfunc_envelopes.R

kfunc_envelopesR Documentation

Perform simulations from a scampr model to calculate global envelopes for the inhomogeneous K function

Description

Perform simulations from a scampr model to calculate global envelopes for the inhomogeneous K function

Usage

kfunc_envelopes(
  model,
  conf.level = 0.95,
  nsims = 100,
  Kfun.correction = c("border", "bord.modif", "isotropic", "translate"),
  return.data = F,
  spatstat.win,
  dists = NULL
)

Arguments

model

a scampr model object

conf.level

a numeric between 0 and 1 indicating the confidence level of the global envelope test

nsims

an integer describing the number of simulations to conduct

Kfun.correction

a character string describing the correction type to be used. See spatstat::Kinhom() for details.

return.data

a logical indicating whether to return the observed and simulated data

spatstat.win

Optionally, a spatstat window object.

dists

a vector of values for the distances at which the inhomogeneous K function should be evaluated. Not normally given by the user; spatstat provides a sensible default.

Value

Optionally, a list of the observed and simulated K functions - see GET::create_curve_set(). Results are plotted.

Examples

# Get the data
dat <- scampr::gorillas
dat$elev <- scale(dat$elevation)
mod <- scampr(pres ~ elev, dat, model.type = "PO", include.sre = F)
kfunc_envelopes(mod)

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