Learn R Programming

xoi (version 0.72)

kfunc: estimate Ripley's K function

Description

estimate the 1-d version of Ripley's K function

Usage

kfunc(
  x,
  d = seq(0, 100, by = 0.1),
  lengths = NULL,
  exclude = 0,
  tol = 0.000001
)

Value

data frame with d, k, and se

Arguments

x

list with sorted locations of the data

d

values at which to calculate the function

lengths

lengths of segments studied

exclude

distance to exclude

tol

tolerance value

See Also

gammacoi(), stahlcoi(), coincidence()

Examples

Run this code
L <- 103
n <- 2000
map1 <- sim.map(L, n.mar=104, anchor=TRUE, include.x=FALSE, eq=TRUE)
x <- sim.cross(map1, n.ind=n, m=6, type="bc")

xoloc <- find.breaks(x)

d <- seq(0, 100, by=0.1)[-1]
kf <- kfunc(xoloc, d=d, lengths=rep(L, n))

plot(k ~ d, data=kf, type="n", yaxs="i", xaxs="i", las=1,
     ylim=c(0, max(kf$k + kf$se)))
polygon(c(kf$d, rev(kf$d)), c(kf$k + kf$se, rev(kf$k-kf$se)),
        border=NA, col="#add8e650")
lines(k ~ d, data=kf)

Run the code above in your browser using DataLab