integral.tessfun {spatstat.geom} | R Documentation |
Integrate a Function Which is Constant on Each Tile of a Tessellation
Description
Given a function which is constant on each tile of a tessellation, compute the integral of the function.
Usage
## S3 method for class 'tessfun'
integral(f, domain = NULL, ...)
Arguments
f |
Integrand. A function of class |
domain |
Optional window (object of class |
... |
Ignored. |
Details
The command integral
is generic.
This is the method for objects of class "tessfun"
.
The integrand f
should be a function of class
"tessfun"
created by as.function.tess
.
It represents a function which takes a constant value
on each tile of a tessellation.
The integral is calculated by multiplying the area of each tile by the value of the function in that tile, and summing. This avoids the need for discretisation and avoids concomitant discretisation errors.
Value
A single numeric value.
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au.
See Also
Examples
V <- dirichlet(runifrect(5))
f <- as.function(V, values=1/tile.areas(V))
integral(f) # should be close to 5.