dot-sampleRastSubregion: Select random points from a portion of a raster

.sampleRastSubregionR Documentation

Select random points from a portion of a raster

Description

This function selects random points from a randomly-selected subregion of raster. The subregion is selected by randomly locating a point on the any non-NA cell in the raster, buffering it by a given width, rasterizing the buffered area, then selecting from any non-NA cells in this region.

Usage

.sampleRastSubregion(rast, n, width, restrict = TRUE, circleCent = NULL, ...)

Arguments

rast

Raster, RasterStack, or RasterBrick demarcating the area in which randomized sites are to be placed. If a RasterStack or a RasterBrick is used then the first layer will be used (i.e., so cells with NA will not have points located within them).

n

Positive integer, number of random points to select.

width

Positive numeric, size of buffer radius (in map units–usually meters).

restrict

Logical, if TRUE (default), then select random points from any non-NA cell in a restricted area. If FALSE, then select from any non-NA cell on the raster. If FALSE, then is exactly the same as using randomPoints except that it automatically returns a SpatialPoints object for the random points.

circleCent

A SpatialPoints or SpatialPointsDataFrame object. The default value is NULL, in which case a centroid for the circle is randomly chosen. If supplied, then this will be the center of the circle.

...

Other arguments (not used).

Value

A list object with four elements: 1) A SpatialPoints object of randomly selected points; 2) a SpatialPoints object representing the center of the circle chosen to represent the subregion; 3) a numeric value representing the buffer width; and 4) a numeric value representing the number of non-NA cells in the region from which the points were selected.


adamlilith/enmSdm documentation built on Jan. 6, 2023, 11 a.m.