library(spatstat) f = function(x,y,l=100) { return(l*(3*x+y)) } # Inhomogeneous Poisson process X = rpoispp(f) plot(X) print(anova(ppm(X, ~ 1), ppm(X,~x+y))) plot(allstats(X)) plot(density(X)) # Poisson cluster process X = rThomas(20, 0.01, 10) plot(X) # A little less extreme X = rThomas(20, 0.1, 10) plot(X) # An envelope for the G function, yielding pointwise confidence bands # under CSR E = envelope(X, Gest, nsim=100) plot(E) # An envelope for the G function, yielding simultaneous confidence bands # under CSR E = envelope(X, Gest, nsim=100, global=T) plot(E) # A function to generate a Cox process with chi^2 intensity simcox = function(l=100) { W = rnorm(1)^2 + 0.5 X = rpoispp(W*l) plot(allstats(X)) return(X) }