arc2: Arc2 - Africa Rainfall Climatology version 2

View source: R/arc2.R

arc2R Documentation

Arc2 - Africa Rainfall Climatology version 2

Description

Arc2 - Africa Rainfall Climatology version 2

Usage

arc2(date, box = NULL, ...)

Arguments

date

(character/date) one or more dates of the form YYYY-MM-DD

box

(numeric) vector of length 4, of the form ⁠xmin, ymin, xmax, ymax⁠. optional. If not given, no spatial filtering is done. If given, we use dplyr::filter() on a combined set of all dates, then split the output into tibbles by date

...

curl options passed on to crul::verb-GET

Value

a list of tibbles with columns:

  • date: date (YYYY-MM-DD)

  • lon: longitude

  • lat: latitude

  • precip: precipitation (mm)

box parameter

The box parameter filters the arc2 data to a bounding box you supply. The function that does the cropping to the bounding box is dplyr::filter. You can do any filtering you want on your own if you do not supply box and then use whatever tools you want to filter the data by lat/lon, date, precip values.

Note

See arc2_cache for managing cached files

References

docs: https://ftp.cpc.ncep.noaa.gov/fews/fewsdata/africa/arc2/ARC2_readme.txt

Examples

## Not run: 
x = arc2(date = "1983-01-01")
arc2(date = "2017-02-14")

# many dates
arc2(date = c("2019-05-27", "2019-05-28"))
arc2(seq(as.Date("2019-04-21"), by = "day", length.out = 5))
## combine outputs 
x <- arc2(seq(as.Date("2019-05-20"), as.Date("2019-05-25"), "days"))
dplyr::bind_rows(x)

# bounding box filter
box <- c(xmin = 9, ymin = 4, xmax = 10, ymax = 5)
arc2(date = "2017-02-14", box = box)
arc2(date = c("2019-05-27", "2019-05-28"), box = box)
arc2(seq(as.Date("2019-05-20"), as.Date("2019-05-25"), "days"), box = box)

## End(Not run)

ropensci/rnoaa documentation built on June 27, 2023, 4:53 p.m.