HollowRectangle: Subdivide a hyperrectangle with a standard grid

Description Usage Arguments Details Value Examples

View source: R/mvmesh.R

Description

EdgeSubdivision implements the

Usage

1
2
3
4
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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
SolidRectangle( a=c(1,3), b=c(2,7), breaks=2 )
SolidRectangle( a=c(1,3), b=c(2,7), breaks=c(4,10) )
SolidRectangle( a=c(1,3), b=c(2,7), 
    breaks=list( seq(1,3,by=0.25), seq(2,7,by=1) ) )
HollowRectangle( a=c(1,3), b=c(2,7), breaks=2 )
HollowRectangle( a=c(1,3), b=c(2,7), breaks=c(4,10) )
HollowRectangle( a=c(1,3), b=c(2,7), 
    breaks=list( seq(1,3,by=0.25), seq(2,7,by=1) ) )
    

## Not run: 
plot( SolidRectangle( a=c(1,3), b=c(2,7), breaks=3 ), show.labels=TRUE )
plot( SolidRectangle( a=c(1,3), b=c(2,7), breaks=c(4,10) ), show.labels=TRUE )
plot( SolidRectangle( a=c(1,3), b=c(2,7), 
    breaks=list( seq(1,3,by=0.25), seq(2,7,by=1) ) ), show.labels=TRUE )
plot( SolidRectangle( a=c(1,3), b=c(2,7), breaks=3 ), show.labels=TRUE, 
    label.values=letters[1:9], col='green' )
    
plot( HollowRectangle( a=c(1,3,0), b=c(6,7,6), breaks=3 ), show.labels=TRUE, col='blue')
plot( HollowRectangle( a=c(1,3), b=c(2,7), breaks=3 ), show.labels=TRUE )
plot( HollowRectangle( a=c(1,3), b=c(2,7), breaks=c(4,10) ), show.labels=TRUE )
plot( HollowRectangle( a=c(1,3), b=c(2,7), 
    breaks=list( seq(1,3,by=0.25), seq(2,7,by=1) ) ), show.labels=TRUE )
plot( HollowRectangle( a=c(1,3), b=c(2,7), breaks=3 ), show.labels=TRUE, 
    label.values=letters[1:9], col='green' )

## End(Not run)    

mvmesh documentation built on Feb. 12, 2020, 1:09 a.m.