The surface is converted to a binary pixel image
using the as.im.function method from package
spatstat (Baddeley and Turner, 2005).
The integral under the surface is then approximated as the
sum over (pixel area * f(pixel midpoint)).
polyCub.midpoint(polyregion, f, ..., eps = NULL, dimyx = NULL,
plot = FALSE)a polygonal integration domain.
It can be any object coercible to the spatstat class
"owin" via a corresponding
as.owin-method.
Note that this includes polygons of the classes "gpc.poly" and
"'>SpatialPolygons", because polyCub defines
methods as.owin.gpc.poly and
as.owin.SpatialPolygons, respectively.
a two-dimensional real function. As its first argument it must take a coordinate matrix, i.e., a numeric matrix with two columns, and it must return a numeric vector of length the number of coordinates.
further arguments for f.
width and height of the pixels (squares),
see as.mask.
number of subdivisions in each dimension,
see as.mask.
logical indicating if an illustrative plot of the numerical integration should be produced.
The approximated value of the integral of f over
polyregion.
Baddeley, A. and Turner, R. (2005). spatstat: an R package for analyzing spatial point patterns. Journal of Statistical Software, 12 (6), 1-42.
Other polyCub-methods: polyCub.SV,
polyCub.exact.Gauss,
polyCub.iso, polyCub
# NOT RUN {
# see example(polyCub)
# }
Run the code above in your browser using DataLab