X <- rescale(amacrine)
I <- (marks(X) == "on")
J <- (marks(X) == "off")
if(interactive() && require(spatstat.model)) {
## how to do it normally
mod <- ppm(X ~ marks * x)
lam <- fitted(mod, dataonly=TRUE)
lmin <- min(predict(mod)[["off"]]) * 0.9
} else {
## for package testing
lam <- intensity(X)[as.integer(marks(X))]
lmin <- intensity(X)[2] * 0.9
}
plot(GmultiInhom(X, I, J, lambda=lam, lambdamin=lmin))
# equivalent
plot(GmultiInhom(X, I, J, lambdaI=lam[I], lambdaJ=lam[J], lambdamin=lmin),
main="")
Run the code above in your browser using DataLab