Description Usage Arguments Details Value Author(s) References See Also Examples
Draws a BAS sample from a SpatialPolygons* object
1 | bas.polygon(x, n)
|
x |
A |
n |
Sample size. Number of locations to draw from the union of all
polygons contained in |
A BAS sample is drawn from the union of all polygons in x by
enclosing all polygons in a bounding square and selecting a randomized
Halton sequence of points from the bounding square. Points falling outside
all polygons are discarded until exactly n locations are selected
inside the polygons.
The sampling frame for routine is infinite and contains all (infinitesimally
small) points in the union of polygons in x.
A SDrawSample object, which is a
SpatialPointsDataFrame object containing points in the BAS sample,
in BAS order.
Attributes of the sample points are:
sampleID: A unique identifier for every sample point. This
encodes the BAS order. If BAS order is lost, return[ order(
return$sampleID ),] will resort the
returned object (i.e., return) into BAS order.
geometryID: The ID of the polygon in x which each
sample point falls. The
ID of polygons in x are row.names(geometry(x)).
Any attributes of the original polygons (in x).
Additional attributes of the output object, beyond those which
make it a SpatialPointsDataFrame, are:
frame: Name of the input sampling frame.
frame.type: Type of resource in sampling frame. (i.e., "polygon").
sample.type: Type of sample drawn. (i.e., "BAS").
random.start: The random seed of the random-start Halton sequence
that produced the sample. This is a vector of length 2 whose elements are
random integers between 0 and maxU.
This routine ensures that the point
associated with this index
falls inside a polygon of x. i.e.,
that halton(1,2,random.start) scaled by a square bounding box
(see attribute bas.bbox below)
lies inside a polygon of x.
Note that halton(1,2,random.start+i), for
i > 0, is not guaranteed to fall inside a polygon of x
when scaled by bas.bbox. The sample consists of the point
associated with random.start and the next n-1
Halton points in sequence that fall inside a polygon
of x.
bas.bbox: The square bounding box surrounding x
used to scale Halton points. A scaled Halton sequence of n points
is bas.bbox[,"min"] + t(halton(n,2,random.start)) *
rep( max(diff(t(bas.bbox))), 2).
Trent McDonald
Robertson, B.L., J. A. Brown, T. L. McDonald, and P. Jaksons (2013) "BAS: Balanced Acceptance Sampling of Natural Resources", Biometrics, v69, p. 776-784.
1 2 3 4 5 6 7 8 9 10 11 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.