Fetch zonal statistics from a product for given municipality code and dates.
Arguments
- code_muni
numeric. IBGE municipality code number with 7 digits.
- product
string. Zonal indicator product. Options are:
brdwgd
,terraclimate
.- indicator
string. Indicator name from the product. Check the available indicators with the product_info function.
- statistics
string. Statistics name from the indicator. Check the available statistics with the product_info function.
- date_start
date, included in the selection.
- date_end
date, included in the selection, must be equal or greater than
date_start
.
Details
For products with monthly data, like terraclimate
, inform the start and end dates with the fist day of the month. Example: as.Date("2008-06-01")
for June, 2008.
Examples
# \donttest{
fetch_data(
code_muni = 3304557,
product = "brdwgd",
indicator = "tmax",
statistics = "mean",
date_start = as.Date("2008-01-01"),
date_end = as.Date("2008-01-10")
)
#> # A tibble: 10 × 2
#> date value
#> <date> <dbl>
#> 1 2008-01-01 32.3
#> 2 2008-01-02 32.5
#> 3 2008-01-03 35.9
#> 4 2008-01-04 36.8
#> 5 2008-01-05 31.3
#> 6 2008-01-06 27.8
#> 7 2008-01-07 26.0
#> 8 2008-01-08 29.5
#> 9 2008-01-09 29.2
#> 10 2008-01-10 31.1
# }