model.images(object, W = as.owin(object), ...)
"ppm"
.)"owin"
) in which the
images should be computed. Defaults to the window
in which the model was fitted.na.action
) passed to
model.matrix.lm
."listof"
consisting of
a named list of pixel images (objects of class "im"
).model.matrix.ppm
except
that it computes pixel images of the covariates,
instead of computing the covariate values at certain points only. The object
must be a fitted spatial point process model
(object of class "ppm"
) produced by the model-fitting
function ppm
.
The spatial covariates required by the model-fitting procedure
are computed at every pixel location in the window W
.
Note that the spatial covariates computed here are not the original covariates that were supplied when fitting the model. Rather, they are the covariates that actually appear in the loglinear representation of the (conditional) intensity and in the columns of the design matrix. For example, they might include dummy or indicator variables for different levels of a factor, depending on the contrasts that are in force.
The pixel resolution is determined by W
if W
is a mask (that is W$type = "mask"
).
Otherwise, the pixel resolution is determined by
spatstat.options
.
The result is a named list of pixel images (objects of class
"im"
) containing the values of the spatial covariates.
The names of the list elements are the names of the covariates
determined by model.matrix.lm
.
The result is also of class "listof"
so that it can
be plotted immediately.
model.matrix.ppm
,
ppm
,
ppm.object
,
im
,
im.object
,
plot.listof
,
spatstat.options
data(cells)
fit <- ppm(cells, ~x)
model.images(fit)
fit2 <- ppm(cells, ~cut(x,3))
model.images(fit2)
Run the code above in your browser using DataLab