"with"(data, expr, ...)"msr").
with for the class "msr".
The argument data should be an object of class "msr"
representing a measure (a function which assigns a value to each
subset of two-dimensional space).This function can be used to extract the components of the measure, or to perform more complicated manipulations of the components.
The argument expr should be an un-evaluated expression
in the R language. The expression may involve any of the variable
names listed below with their corresponding meanings.
qlocations |
| (point pattern) all quadrature locations |
qweights |
| (numeric) all quadrature weights |
density |
| (numeric) density value at each quadrature point |
discrete |
| (numeric) discrete mass at each quadrature point |
continuous |
| (numeric) increment of continuous component |
increment |
| (numeric) increment of measure |
is.atom |
| (logical) whether quadrature point is an atom |
atoms |
| (point pattern) locations of atoms |
An object of class "msr" approximates the continuous component
by a sum over quadrature points. The quadrature points are chosen
so that they include the atoms of the measure. In the list above,
we have increment = continuous + discrete,
continuous = density * qweights,
is.atom = (discrete > 0),
atoms = qlocations[is.atom] and
atommass = discrete[is.atom].
msr,
split.msr
X <- rpoispp(function(x,y) { exp(3+3*x) })
fit <- ppm(X, ~x+y)
rp <- residuals(fit, type="pearson")
with(rp, atoms)
with(rp, qlocations %mark% continuous)
Run the code above in your browser using DataLab