download_terraclimate {cropDemand}R Documentation

Download of reference evapotranspiration (eto) and rainfall (ppt) from 'TerraClimate'

Description

This function will download the eto and ppt and will load a SpatRaster according to the the region of interest (Region and sub_region).

Usage

download_terraclimate(dir_out, variable, years, region, sub_region)

Arguments

dir_out

Directory where you want to save the raster images that you are goind to download.

variable

Variable to download. This function will download the eto or ppt (SpatRaster).

years

The period in years that the function should download images.

region

Use the "brazil" shapefile to extract the SpatRaster (variable) for one state (Brazilian state), or use the "biomes_brazil" to extract the SpatRaster (variable) for one biome of Brazil.

sub_region

You have two options in this section, if you choice the brazil (in region parameter) you need to choice the Brazilian states, but if you choice the biomes_brazil (in region parameter) you must choice one of Brazilian biomes.

Value

Download for the region of interest the ppt (Rainfall) or eto (reference evapotranspiration) SpatRaster

References

The images used in this package can be found in the paper: Abatzoglou, J.T., S.Z. Dobrowski, S.A. Parks, K.C. Hegewisch, 2018, Terraclimate, a high-resolution global dataset of monthly climate and climatic water balance from 1958-2015, Scientific Data.

Examples

## Not run: 

### Downloading eto based on Brazil states.
see_brazil_states()

img<-download_terraclimate(variable = "eto",
                          years = c(2018:2019),
                          region = "brazil",
                          sub_region = 13)

### Downloading the ppt based on Brazil biomes.
see_brazil_biomes()

img<-download_terraclimate(variable = "ppt",
                          years = c(2018:2019),
                          region = "biomes_brazil",
                          sub_region = 6)

## End(Not run)

[Package cropDemand version 1.0.3 Index]