I'm reading the documentation on the Kest
function (page 731) from the spatstat package.
For the argument $r$, that is the "Vector of values for the argument $r$ at which $K(r)$ should be evaluated", it states that:
Users are advised not to specify this argument; there is a sensible default.
I'm interested in knowing how this argument is specified. I went to look at the source for this function but I'm not an expert on R
(I write in Python
) and I can't decipher how it is calculated.
I know that the piece of code that determines this is here:
rmaxdefault <- rmax %orifnull% rmax.rule("K", W, lambda)
if(is.infinite(rmaxdefault)) rmaxdefault <- diameter(W)
breaks <- handle.r.b.args(r, breaks, W, rmaxdefault=rmaxdefault)
r <- breaks$r
rmax <- breaks$max
(...)
# recommended range of r values
alim <- c(0, min(rmax, rmaxdefault))
Assuming rmax=NULL
(the default) and a rectangular window, could you explain how the final vector alim
is obtained?