Title: Fetch Zonal Statistics of Weather Indicators for Brazilian Municipalities
Version: 0.2.0
Description: Fetches zonal statistics from weather indicators that were calculated for each municipality in Brazil using data from the BR-DWGD and TerraClimate projects. Zonal statistics such as mean, maximum, minimum, standard deviation, and sum were computed by taking into account the data cells that intersect the boundaries of each municipality and stored in Parquet files. This procedure was carried out for all Brazilian municipalities, and for all available dates, for every indicator available in the weather products (BR-DWGD and TerraClimate projects). This package queries on-line the already calculated statistics on the Parquet files and returns easy-to-use data.frames.
License: MIT + file LICENSE
URL: https://rfsaldanha.github.io/brclimr/, https://github.com/rfsaldanha/brclimr
Encoding: UTF-8
RoxygenNote: 7.3.1
Imports: checkmate, rlang, lobstr, magrittr, DBI, duckdb, glue
Suggests: testthat (≥ 3.0.0), spelling
Config/testthat/edition: 3
Depends: R (≥ 2.10)
LazyData: true
Language: en-US
NeedsCompilation: no
Packaged: 2024-04-04 07:47:55 UTC; raphael
Author: Raphael Saldanha ORCID iD [aut, cre], Reza Akbarinia [aut], Patrick Valduriez [aut], Marcel Pedroso [aut], Victor Ribeiro [aut], Carlos Cardoso [aut], Eduardo Pena [aut], Fabio Porto [aut]
Maintainer: Raphael Saldanha <raphael.de-freitas-saldanha@inria.fr>
Repository: CRAN
Date/Publication: 2024-04-04 08:03:15 UTC

Pipe operator

Description

See magrittr::%>% for details.

Usage

lhs %>% rhs

Arguments

lhs

A value or the magrittr placeholder.

rhs

A function call using the magrittr semantics.

Value

The result of calling rhs(lhs).


BR-DWGD zonal statistics data

Description

A list with BR-DWGD zonal indicators data.

Usage

brdwgd_data

Format

An object of class list of length 7.


Fetch zonal statistics

Description

Fetch zonal statistics from a product for given municipality code and dates.

Usage

fetch_data(code_muni, product, indicator, statistics, date_start, date_end)

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.

Value

A tibble with date and value columns.

Examples

## Not run: 
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")
 )
 
## End(Not run)

Print product information, indicators acronyms and available statistics

Description

Print product information, indicators acronyms and available statistics

Usage

product_info(product)

Arguments

product

Zonal indicator product. Options are: brdwgd, terraclimate.

Value

Printed list tree on the console.

Examples

product_info("terraclimate")

TerraClimate zonal statistics data

Description

A list with TerraClimate zonal indicators data.

Usage

terraclimate_data

Format

An object of class list of length 14.