R: Subdivide a hyperrectangle with a standard grid
HollowRectangle
R Documentation
Subdivide a hyperrectangle with a standard grid
Description
EdgeSubdivision implements the
Usage
HollowRectangle( a, b, breaks=5, silent=FALSE )
SolidRectangle( a, b, breaks=5, silent=FALSE )
mvmeshRectBreaks( a, b, breaks, silent )
NextMultiIndex( i, n )
Arguments
a
vector specifying the "lower left" vertex of the rectangle
b
vector specifying the "upper right" vertex of the rectangle
breaks
a specification of the subdivision scheme. See details below.
silent
indicates whether or not to warn the caller if the subdivision
determined by 'breaks' covers the whole hyperrectangle [a,b].
i
integer vector
n
integer vector
Details
RectangularMesh computes an rectangular mesh on the hyperrectangle
[a,b] = [a[1],b[1]] x [a[2],b[2]] x ... x [a[n],b[n]]. It is similar to
the function mesh in CRAN package plot3D, but works for dimension d=2,3,4,...
'breaks' determines how
each component is divided, it is motivated by the argument breaks in hist.
If 'breaks' is a vector of length n, then breaks[i] gives the number of evenly
sized bins in coordinate i, spread out over the range [a[i],b[i]].
If 'breaks' is a single number m, then each component
is subdivided into that many bins, i.e. this is equivalent to breaks=rep(m,n).
Thus the default breaks=6 subdivides each coordinate into 6 bins.
Finally, if a more complicated subdivision is desired, 'breaks' can a list
with n fields. breaks[[i]] should be a vector of dividing points for coordinate i.
See the example below. In this last case, where the bin boundaries are explictly
defined, 'a' and 'b' are not used (other than a possible warning if the specified
bins do not cover the rectangle given by 'a' and 'b').
Value
An object of class "mvmesh" as described in mvmesh.