Skip to contents

Downloads one global NetCDF per calendar year from the Climate Hazards Center ([CHIRPS 2.0 daily p05](https://data.chc.ucsb.edu/products/CHIRPS-2.0/global_daily/netcdf/p05/)). Files are global; subset to a region in a separate step. Skips years that already exist under `outdir`.

Usage

download.CHIRPS(
  outdir,
  years,
  resolution = "p05",
  base_url =
    sprintf("https://data.chc.ucsb.edu/products/CHIRPS-2.0/global_daily/netcdf/%s",
    resolution)
)

Arguments

outdir

Directory for `chirps-v2.0.YEAR.days_RESOLUTION.nc`.

years

Integer vector of calendar years.

resolution

Character resolution code (default `"p05"`).

base_url

CHC HTTP root for daily NetCDF (override for tests).

Value

Character vector of output file paths (invisibly).

Examples

if (FALSE) { # \dontrun{
download.CHIRPS(tempdir(), 2023)
download.CHIRPS("/data/chirps", c(2023, 2024))
} # }