| integral.linim | R Documentation |
Computes the integral (total value) of a function or pixel image over a linear network.
## S3 method for class 'linim'
integral(f, domain=NULL, weight=NULL, ...)
## S3 method for class 'linfun'
integral(f, domain=NULL, weight=NULL, ..., exact=FALSE, delta, nd)
f |
A pixel image on a linear network (class |
domain |
Optional window specifying the domain of integration.
Alternatively a tessellation (class |
weight |
Optional numerical weight function for the integration.
A pixel image (object of class |
... |
Ignored. |
exact |
Logical value specifying whether to use a more accurate (and slower) calculation method. See Details. |
delta |
Optional.
The step length (in coordinate units)
for computing the approximate integral (if |
nd |
Optional.
Integer giving the approximate number of sample points on the
network (if |
The integral (total value of the function over the network) is calculated.
If domain is a window (class "owin") then the integration
will be restricted to this window. If domain is a tessellation
(class "tess" or "lintess")
then the integral of f in each
tile of domain will be computed.
If weight is given, effectively the integral of weight * f
is computed.
For objects of class "linfun" there is the option of using
a more accurate calculation method in which the integral along each
segment of the network is computed separately using the utility
integrate from the stats package.
If exact=TRUE, additional arguments ... are
passed to integrate to control the computation.
A single numeric or complex value
(or a vector of such values if domain is a tessellation).
.
linim,
integral.im,
integrate
# make a function and image data
xcoord <- linfun(function(x,y,seg,tp) { x }, simplenet)
integral(xcoord)
integral(xcoord, exact=TRUE)
X <- as.linim(xcoord)
integral(X)
# integrals inside each tile of a tessellation
A <- quadrats(Frame(simplenet), 3)
integral(X, A)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.