Take a random sample from the cell values of a Raster* object (without replacement).
Usage
sampleRandom(x, size, ...)
Arguments
x
a Raster object
size
positive integer giving the number of items to choose.
...
Additional arguments:
na.rm Logical. If TRUE (the default), NA values are removed from random sample
ext Extent. To limit regular sampling to the area within the extent
cells
Value
A vector, matrix (if cells=TRUE or x is a multi-layered object), or a SpatialPointsDataFrame (if sp=TRUE )
Details
With na.rm=TRUE, the returned sample may be smaller than requested