[R] Turning ppp into im in spatstat

Sebastian Schutte schutte at icr.gess.ethz.ch
Sun Oct 24 16:05:28 CEST 2010


Dear all,

I'm working with two point patterns (ppp) in spatstat. I turned one of
them into a spatial covariate (im) object. After that, I used this im
object to fit a Poisson model for the second point pattern, using the
covariate layer from the first one.

In R, the whole thing looks somewhat like this:

my_first.im <- as.im(my_first.ppp)
test.ppm <- ppm (my_second.ppp, ~my_first,
                covariates = list (my_first = my_first.im))

The fitting seems to be working, but when I try to simulate a point
pattern with the model I get an error message that Google doesn't know:

rmh (test.ppm)

Extracting model information...Evaluating trend...done.
Checking arguments..determining simulation windows...Error in
rmh.default(X, start = start, control = control, ..., verbose = verbose) :
  Expanded simulation window does not contain model window

I checked the my_first.im$xrange and my_first.im$yrange and found it to
be congruent with the bbox of the ppp.
It would be very nice if someone could give me hint on why this error
occurs and whether or not there is a possible workaround.

Thanks in advance,
Sebastian Schutte



More information about the R-help mailing list