I am using package spatstat to analyze two spatial point pattern datasets.

Object U is a ppp object of the distribution of grassland sites at a
particular elevation/site
Object A is a ppp object of a subset of those locations undergoing a process
of interest to me.

My goal is to detect whether points in A are clustered in space, while
taking into account the fact that there is already some underlying spatial
structure (so this is not a homogeneous point pattern).

So I smoothed out my reference (U), calculated a predicted intensity, and
computed the inhomogeneous K function.

Relevant portions of my code look like this:

dens=density(U)
nn=npoints(A)/npoints(U)
intens= eval.im(dens*nn)
r=seq(0,15000,by=250) # because my points are spaced apart in 250m intervals
and I am not interested in clustering at distances greater than 15k
e=expression(rpoispp(intens))
res=(envelope(A, Kinhom, lambda=dens, r=r, simulate=e,nsim=99,
correction="Ripley", verbose=FALSE))

However, in running this function, I get this warning for every single
dataset.

 In envelopeEngine(X = X, fun = fun, simul = simrecipe, nsim = nsim,  :
Window containing simulated patterns is not a subset of data window

Can anyone shed some light on why I see these errors? While creating my ppp
object, I added a sufficient border (300m on all sides) and even used the
same sized window for both the underlying distribution of points (U) and
points of interest (A). I tried to add the exact same window to rpoispp but
that didn't help.

	[[alternative HTML version deleted]]

