This vignette demonstrates the typical workflow for working with INMET data using climateBR.
The workflow consists of three steps:
For most applications, we recommend using data from 2008 onwards, as the INMET network became substantially more complete from this period. Earlier years are available, but the number of operating weather stations is considerably smaller, which may affect spatial coverage and analyses.
The first step is downloading the original files published by INMET.
Once the files have been downloaded, they can be converted into a partitioned Arrow dataset. This only needs to be done once and allows much faster access for subsequent analyses.
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).
Keeping collect = FALSE is generally recommended when
working with large time spans, as the full INMET database contains
millions of observations. Loading all records into memory with
collect = TRUE may exceed the available RAM and cause R to
explode.
Depending on the selected years, it is also good practice to inspect
and clean the observations before analysis. In some historical INMET
files, missing values are encoded as -9999 instead of
NA, so these values should be converted to proper missing
values before computing summaries or running models.