Create raster mask based on coordinates
extrap_mask.Rd
Creates a raster that can be used to mask areas falling outside the observation range of a dataset, as defined by coordinates and corresponding raster values
Usage
extrap_mask(coords, envlayers, method = "range", nsd = 2, buffer_width = NULL)
range_mask(coords, envlayers)
sd_mask(coords, envlayers, nsd)
buffer_mask(coords, envlayers, buffer_width = 0.8)
chull_mask(coords, envlayers, buffer_width = NULL)
Arguments
- coords
data frame of coordinates (first column should be x and second should be y)
- envlayers
SpatRaster or Raster* object with environmental values to base mask on
- method
method to create mask (can be "range", "sd", "buffer", defaults to "range"). See details for more information.
- nsd
number of standard deviations to use if using the "sd" method
- buffer_width
buffer width to supply to
gBuffer
if using "buffer" method
Details
method can either be:
range - uses
range_mask
, mask all areas with values outside of the range of any of the values of the coordssd - uses
sd_mask
, mask all areas outside the mean +/- stdev*nsd of any of the values of the coords (nsd
defaults to 2)buffer - uses
buffer_mask
, mask all areas outside of the buffer_width around the coords (buffer_width
defaults to 0.8)chull - uses
chull_mask
, mask all areas outside a convex hull of the points