Learn R Programming

amadeus (version 1.2.2)

process_terraclimate: Process TerraClimate data

Description

The process_terraclimate() function imports and cleans climate and water balance data, returning a single SpatRaster object.

Usage

process_terraclimate(
  date = c("2023-09-01", "2023-09-10"),
  variable = NULL,
  path = NULL,
  extent = NULL,
  ...
)

Value

a SpatRaster object

Arguments

date

character(1 or 2). Date (1) or start and end dates (2). Format YYYY-MM-DD (ex. September 1, 2023 = "2023-09-01").

variable

character(1). Variable name or acronym code. See TerraClimate Direct Downloads for variable names and acronym codes.

path

character(1). Directory with downloaded netCDF (.nc) files.

extent

numeric(4) or SpatExtent giving the extent of the raster if NULL (default), the entire raster is loaded

...

Placeholders.

Author

Mitchell Manware

Examples

Run this code
## NOTE: Example is wrapped in `\dontrun{}` as function requires a large
##       amount of data which is not included in the package.
if (FALSE) {
terraclimate <- process_terraclimate(
  date = c("2023-01-01", "2023-01-10"),
  variable = "Precipitation",
  path = "./data/ppt"
)
}

Run the code above in your browser using DataLab