Displaying 1 result from an estimated 1 matches for "spatsat".
Did you mean:
spatstat
2007 Oct 03
2
Speeding up simulation of mean nearest neighbor distances
I've written the function below to simulate the mean 1st through nth
nearest neighbor distances for a random spatial pattern using the
functions nndist() and runifpoint() from spatsat. It works, but runs
relatively slowly - would appreciate suggestions on how to speed up
this function. Thanks. --Dale
library(spatstat)
sim.nth.mdist <- function(nth,nsim) {
D <- matrix(ncol=nth, nrow=nsim)
for (i in 1:nsim) {
rpp <- runifpoint(22, win=owin(c(0,1),c(0,1)), giveup=1000...