# NOT RUN {
DA <- density(split(amacrine))
DA
im.apply(DA, max)
im.apply(DA, sum)
## Example with incompatible patterns of NA values
Z <- density(split(ants))
B <- owin(c(438, 666), c(80, 310))
Z[[1]][B] <- NA
opa <- par(mfrow=c(2,2))
plot(Z[[1]])
plot(Z[[2]])
#' Default action: NA -> NA
plot(im.apply(Z, mean))
#' Use NA handling in mean.default
plot(im.apply(Z, mean, na.rm=TRUE, fun.handles.na=TRUE))
par(opa)
# }
Run the code above in your browser using DataLab