Nothing
#
# intensity.R
#
# Code related to intensity and intensity approximations
#
# $Revision: 1.24 $ $Date: 2022/05/23 02:33:06 $
#
intensity <- function(X, ...) {
UseMethod("intensity")
}
intensity.ppp <- function(X, ..., weights=NULL) {
n <- npoints(X)
a <- area(Window(X))
if(is.null(weights)) {
## unweighted case - for efficiency
if(is.multitype(X)) {
mks <- marks(X)
answer <- as.vector(table(mks))/a
names(answer) <- levels(mks)
} else answer <- n/a
return(answer)
}
## weighted case
weights <- pointweights(X, weights=weights, parent=parent.frame())
if(is.multitype(X)) {
mks <- marks(X)
answer <- as.vector(tapply(weights, mks, sum))/a
answer[is.na(answer)] <- 0
names(answer) <- levels(mks)
} else {
answer <- sum(weights)/a
}
return(answer)
}
intensity.splitppp <- function(X, ..., weights=NULL) {
if(is.null(weights))
return(sapply(X, intensity.ppp))
if(is.expression(weights))
return(sapply(X, intensity.ppp, weights=weights))
if(is.numeric(weights)) {
fsplit <- attr(X, "fsplit")
n <- length(fsplit)
check.nvector(weights, n, vname="weights")
result <- mapply(intensity.ppp, X, weights=split(weights, fsplit))
result <- simplify2array(result, higher=FALSE)
return(result)
}
stop("Unrecognised format for weights")
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.