positive integer giving the number of items to choose.
ext
Extent. To limit regular sampling to the area within that box
cells
Logical. Also return sampled cell numbers (if asRaster=FALSE)
asRaster
Logical. If TRUE, a RasterLayer or RasterBrick is returned, rather then the sampled values
useGDAL
Logical. If TRUE, GDAL is used to sample in some cases. This is quicker, but can result in values for a different set of cells. Only for rasters that are accessed via rgdal, are not rotated, and when cells=FALSE.
Value
A vector, matrix (if cells=TRUE; or for a multi-layered object), or RasterLayer (if asRaster=TRUE)