sample_region_slice: Sample points from a region time slice

View source: R/sample_region_slice.R

sample_region_sliceR Documentation

Sample points from a region time slice

Description

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

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).

Value

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


EvolEcolGroup/pastclim documentation built on Nov. 6, 2023, 5:11 a.m.