This function transforms a list of GCM stacks by subsetting it to include only the variables
specified in var_names
, reprojecting it to match the CRS of study_area
,
cropping and masking it to study_area
, and returning a list of data frames.
transform_gcms(s, var_names = c("bio_1", "bio_12"), study_area = NULL)
A list of data frames, where each element corresponds to a GCM in the input list.
A list of stacks of General Circulation Models (GCMs).
Character. A vector of names of the variables to include, or 'all' to include all variables.
An Extent object, or any object from which an Extent object can be extracted. Defines the study area for cropping and masking the rasters.
Luíz Fernando Esser (luizesser@gmail.com) https://luizfesser.wordpress.com
summary_gcms
var_names <- c("bio_1", "bio_12")
s <- import_gcms(system.file("extdata", package = "chooseGCM"), var_names = var_names)
study_area <- terra::ext(c(-80, -30, -50, 10)) |> terra::vect(crs="epsg:4326")
transform_gcms(s, var_names, study_area)
Run the code above in your browser using DataLab