Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

with.msr

Evaluate Expression Involving Components of a Measure


Description

An expression involving the names of components of a measure is evaluated.

Usage

## S3 method for class 'msr'
with(data, expr, ...)

Arguments

data

A measure (object of class "msr").

expr

An expression to be evaluated.

...

Ignored.

Details

This is a method for the generic function 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
atommass (numeric) massess of atoms

The measure is the sum of discrete and continuous components. The discrete component assigns non-zero mass to several points called atoms. The continuous component has a density which should be integrated over a region to determine the value for that region.

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].

Value

The result of evaluating the expression could be an object of any kind.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

See Also

Examples

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)

spatstat.core

Core Functionality of the 'spatstat' Family

v2.1-2
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Kasper Klitgaard Berthelsen [ctb], Achmad Choiruddin [ctb], Jean-Francois Coeurjolly [ctb], Ottmar Cronie [ctb], Tilman Davies [ctb], Julian Gilbey [ctb], Yongtao Guan [ctb], Ute Hahn [ctb], Kassel Hingee [ctb], Abdollah Jalilian [ctb], Marie-Colette van Lieshout [ctb], Greg McSwiggan [ctb], Tuomas Rajala [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Plenge Waagepetersen [ctb], Hangsheng Wang [ctb]
Initial release
2021-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.