Skip to contents

This function samples points from a region time slice (i.e. a time point).

Usage

sample_region_slice(x, size, method = "random", replace = FALSE, na.rm = TRUE)

Arguments

x

a terra::SpatRaster returned by region_slice()

size

number of points sampled.

method

one of the sampling methods from terra::spatSample(). It defaults to "random"

replace

boolean determining whether we sample with replacement

na.rm

boolean determining whether NAs are removed

Value

a data.frame with the sampled cells and their respective values for the climate variables.

Details

This function wraps terra::spatSample() to appropriate sample the terra::SpatRaster returned by region_slice(). You can also use terra::spatSample() directly on a slice (which is a standard terra::SpatRaster).