sampleRandom(x, size,...)
sampleRegular(x, size, extent=NULL, cells=FALSE, asRaster=FALSE, corners=FALSE)
na.rm
. If TRUE
NA values are removed from random sampleTRUE
, a rasterLayer is returned, rather then the sampled valuesTRUE
, the extreme corner cells are always included. This makes for rather irregular sampling when n is small; but it can be useful when asRaster=TRUE, to maintain the same extent as the input RasterLayerr <- raster(system.file("external/test.grd", package="raster"))
v <- sampleRegular(r, size=100)
Run the code above in your browser using DataLab