Description Usage Arguments Details Value See Also Examples
Take a stratified random sample from the cell values of a Raster* object (without replacement). An attempt is made to sample size
cells from each stratum. The values in the RasterLayer x
are rounded to integers; with each value representing a stratum.
1 2 |
x |
Raster* object, with values (rounded to integers) representing strata |
size |
positive integer giving the number of items to choose |
exp |
numeric >= 1. 'Expansion factor' that is multiplied with size to get an intial sample. Can be increased when you get an insufficient number of samples for small strata |
na.rm |
logical. If |
xy |
logical. Return coordinates of cells rather than cell numbers |
ext |
Extent object. To limit regular sampling to the area within the extent |
sp |
logical. If |
... |
Additional arguments. None implemented |
The function may not work well when the size (number of cells) of some strata is relatively small.
matrix of cell numbers (and optionally coordinates) by stratum
1 2 3 4 |
Loading required package: sp
cell stratum
[1,] 16 2
[2,] 3 2
[3,] 45 2
[4,] 32 3
[5,] 80 3
[6,] 6 3
[7,] 84 4
[8,] 23 4
[9,] 22 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.