download_rain: Download monthly rainfall data for countries

Description Usage Arguments Value References Examples

Description

download_rain() downloads monthly rainfall data from the Climate Research Unit at the University of East Anglia (http://www.cru.uea.ac.uk/).

Usage

1
download_rain(country = NULL, long = T, delete_raw = T)

Arguments

country

Character vector of ISO3 codes for the countries for which rainfall data is to be downloaded. I suggest using the excellent countrycode package to retrieve ISO3 codes from country names.

long

Logical. If TRUE, the resulting data frame is a tidy output in which every observation is a country-year month of rainfall data. If FALSE every row is a year with the JAN to DEC monthly values as columns.

delete_raw

Logical. Delete local copies of the downloaded CRU files? Defaults to TRUE.

Value

If long == TRUE download_rain() returns a data frame / tibble with the following variables:

References

Harris, I, PD Jones, TJ Osborn & DH Lister (2014) Updated high-resolution grids of monthly climatic observations - the CRU TS3.10 Dataset. International Journal of Climatology 34(3): 623-642.

Examples

1
2
3
4
5
6
## Not run: 
# Download rainfall data for the Democratic Republic of the Congo.
rain_drc <- download_rain(country = "COD", long = T, delete_raw = T)


## End(Not run)

felixhaass/rainfall documentation built on May 16, 2019, 12:48 p.m.