Learn R Programming

chooseGCM (version 1.0.1)

transform_gcms: Transform General Circulation Model (GCM) Stacks

Description

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.

Usage

transform_gcms(s, var_names = c("bio_1", "bio_12"), study_area = NULL)

Value

A list of data frames, where each element corresponds to a GCM in the input list.

Arguments

s

A list of stacks of General Circulation Models (GCMs).

var_names

Character. A vector of names of the variables to include, or 'all' to include all variables.

study_area

An Extent object, or any object from which an Extent object can be extracted. Defines the study area for cropping and masking the rasters.

Author

Luíz Fernando Esser (luizesser@gmail.com) https://luizfesser.wordpress.com

See Also

summary_gcms

Examples

Run this code
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