climateBR supports research on climate shocks by providing functions for each stage of working with climate data:
download_inmet() downloads the ZIP files with INMET
weather station data from the Brazilian government’s website.build_inmet_dataset() converts the raw files into a
partitioned dataset.read_inmet() reads and filters that dataset.nearest_stations() and kriging_inmet()
link municipalities to INMET stations, so climate data can be merged
with other sources, such as IBGE or TSE, for statistical analysis.This vignette demonstrates the core workflow of climateBR.
First, download the original files published by INMET.
Next, convert the downloaded files into a partitioned Arrow dataset. This only needs to be done once and makes later analyses much faster.
The read_inmet() function reads the partitioned dataset
and can return either an Arrow Dataset (collect = FALSE) or
an in-memory data frame (collect = TRUE).
Keep collect = FALSE when working with long time spans:
the full INMET dataset contains millions of observations, and loading
all of them into memory with collect = TRUE may exceed the
available RAM and crash R.
Inspect and clean the observations before analysis. In some
historical INMET files, missing values are coded as -9999
instead of NA; convert them to NA before
computing summaries or fitting models.
When using climateBR in academic publications, please
cite the package as follows:
citation("climateBR")
#> To cite package 'climateBR' in publications use:
#>
#> Bárbara K (2026). _climateBR: Download Rainfall, Temperature, and
#> Wind Data from Brazil_. R package version 0.2.5,
#> <https://github.com/kaiorb52/climateBR>.
#>
#> A BibTeX entry for LaTeX users is
#>
#> @Manual{,
#> title = {climateBR: Download Rainfall, Temperature, and Wind Data from Brazil},
#> author = {Kaio Bárbara},
#> year = {2026},
#> note = {R package version 0.2.5},
#> url = {https://github.com/kaiorb52/climateBR},
#> }