Description Usage Arguments Details Value Author(s) See Also Examples
Draw a systematic sample from a SpatialPoints*
object or a data.frame
.
SpatialPoints*
objects can represent point resources in 2-dimensional space, such as towns, event locations,
or grid cell centers.
1 | srs.point(x, n)
|
x |
A |
n |
Sample size. Number of points or rows to draw from |
When x
is a data frame, the simple random sample is drawn from the rows. That is,
each row is viewed as a sample unit.
This draws equi-probable sample. First order inclusion probabilities are n/N for all units.
If input x
inherits from a the SpatialPoints
class, a
SpatialPointsDataFrame
object containing locations and attributes in the sample is returned.
If input x
is a data.frame
, a data.frame
is returned.
Attributes of the returned sample points are:
sampleID
: A unique identifier for every sample point.
sampleID
starts with 1 at the first point and
increments by one for each.
If x
inherits from SpatialPoints
,
returned points have attribute geometryID
– the ID (= row.names(x)
) of
the sampled point.
Any attributes (columns) associated with the input points (rows).
Additional attributes of the output object are:
frame
: Name of the input sampling frame (i.e., x
).
frame.type
: Type of resource in sampling frame. (i.e., "point").
sample.type
: Type of sample drawn. (i.e., "SRS").
Trent McDonald
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.