integral.tessfun: Integrate a Function Which is Constant on Each Tile of a...

View source: R/tessfun.R

integral.tessfunR 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 "tessfun" (created by as.function.tess).

domain

Optional window (object of class "owin") specifying a subregion to which the integral should be restricted.

...

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

.

See Also

as.function.tess.

Examples

  V <- dirichlet(runifrect(5))
  f <- as.function(V, values=1/tile.areas(V))
  integral(f) # should be close to 5.

spatstat.geom documentation built on April 3, 2025, 7:41 p.m.