kfunc: Inhomogeneous K function for scampr models (is a wrapper of...

View source: R/kfunc.R

kfuncR Documentation

Inhomogeneous K function for scampr models (is a wrapper of spatstat's version). Or calculate the K function from point pattern (and intensity) provided.

Description

Inhomogeneous K function for scampr models (is a wrapper of spatstat's version). Or calculate the K function from point pattern (and intensity) provided.

Usage

kfunc(
  model,
  correction = c("border", "bord.modif", "isotropic", "translate"),
  point.pattern,
  intensity.at.pp,
  spatstat.win,
  intensity.at = c("im", "pts"),
  dists = NULL
)

Arguments

model

a scampr model object

correction

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

point.pattern

Optionally, a data frame, the first two columns of which describe the horizontal and vertical coordinates of point locations respectively.

intensity.at.pp

Optionally, a vector of length nrow(point.pattern) that describes the intensity at each point.

spatstat.win

Optionally, a spatstat window object.

intensity.at

Optionally, a character string, one of either 'im' or 'pts'. Describes whether the intensity used in spatstat.explore::Kinhom() is an image object or just provided at the presence points.

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

a data.frame of two columns - distance (dist) and corresponding K function values (Kfn).

Examples

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

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