randomPts | R Documentation |
Providing a polygon to limit the search area can speed up the search if the polygon is small relative to the area of a layer.
randomPts(x, n = 100, m = 2, na.rm = FALSE, pts = NULL, polygon = NULL)
x |
Raster* layer, brick or stack |
n |
numeric, the number of points to return |
m |
multiplier to use when seeking to avoid missing values. Ignored if polygon is provided. |
na.rm |
logical, if TRUE then avoid cells with missing values. |
pts |
a table of points to avoid. If na.rm is TRUE that is handled first, then point avoidance is handled. Ignored if NULL. |
polygon |
polygon (sfc or SpatialPolygon) that describes the region to select points from. Ignored if NULL. |
a table of locations with values. Note that it is possible to filter the available pool of candidate cells to something less than the requested sample, n. In such cases some samples may be replicates.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.