Create a list of rasters in each rep, at each timestep, for each polygon area

rasterListByPoly(files, polys, names, col, filter)

Arguments

files

character vector giving paths to raster files

polys

polygon object of class sf

names

character vector giving the names of each of the subpolygons in poly

col

character string giving the column name in poly to use

filter

unused; kept for compatibility. The replicate, time and polygon name of each raster are parsed from its folder (repXX) and file name (<prefix>_year<YYYY>).

Value

list of SpatRaster objects, named <repXX>.<prefix>_year<YYYY>_<polyName>, with attributes reps, times, polyNames

Note

uses future_lapply internally to loop across files; set e.g., option future.availableCores.fallback appropriately for your system.