Nothing
rPopulationIndependenceK <-
function (X, ReferenceType, NeighborType, CheckArguments = TRUE) {
if (CheckArguments)
CheckdbmssArguments()
# Eliminate useless points
X.reduced <- X[X$marks$PointType==ReferenceType | X$marks$PointType==NeighborType]
RandomizedX <- X.reduced
# Reduce the factor levels to two (factor eliminates the levels with no points)
Marks <- factor(X.reduced$marks$PointType)
# The new point pattern has classical spatstat marks
RandomizedX <- RandomizedX %mark% Marks
# Split reference and neighbor points
X.split <- split(RandomizedX)
# Randomly shift the neighbors
rshift(X.split, which=NeighborType) -> RandomizedX.split
# Reunify the split point pattern
RandomizedX.split -> split(RandomizedX)
# Reorganize the marks (add weight)
PointWeight <- rep(1, RandomizedX$n)
PointType <- marks(RandomizedX)
marks(RandomizedX) <- data.frame(PointWeight, PointType)
class(RandomizedX) <- c("wmppp", "ppp")
return (RandomizedX)
}
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.