sample_rs_variable: Sample the different number of points from a region time...

View source: R/sample_region_series.R

sample_rs_variableR Documentation

Sample the different number of points from a region time series

Description

Internal function for sampling different number of points for each timestep of a region series from sample_region_series(), used when size is a vector of values.

Usage

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

Arguments

x

a terra::SpatRasterDataset returned by region_series()

size

a vector of the number of points sampled for each time step

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.


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