NEWS.md
Changed: load_mapbiomas() now stops with a clear error for the combinations whose source file MapBiomas no longer serves, instead of failing on the download: "mapbiomas_transition" at geo_level = "municipality" (no newer collection publishes municipality-level transitions; "biome" still works), "mapbiomas_water" at geo_level = "state" ("municipality" and "biome" still work), and "mapbiomas_irrigation" at every level.
Fixed: updated PRODES 2025 raster to revision v20261019 (prodes_amazonia_legal_2025_v20261019.zip), maintaining resolution, grid orientation and raster legend codes.
Fixed: the years listed for several datasets were out of date and are now read from the source files, on every update of the links table. "mapbiomas_mining" reaches 2023 at the municipality level (it said 2022; indigenous land stays at 2022), and "mapbiomas_water" reaches 2024 at the municipality and biome levels (it said 2022; state stays at 2022). load_epe()’s "consumer_energy_consumption" and "industrial_energy_consumption" reach 2026, a partial year, and "industrial_energy_consumption" starts in 2012, not 2004: the source has no earlier industrial data. load_aneel()’s "energy_generation" covers plants dated up to 2026 (it said 2021).
Changed: load_seeg() and load_ips() now include a year the source adds without needing a package update. load_seeg() used to leave a new year out with no error. Output for the years available today is unchanged.
Changed: load_aneel() data cleaning overhauled across all three datasets (energy_generation, energy_development_budget, energy_enterprises_distributed). Drops uninformative system and metadata columns (dat_geracao_conjunto_dados, ide_nucleo_ceg, cod_ceg, nom_fonte_combustivel), standardizes column names to clean snake_case in both Portuguese and English (empreendimento, uf, tipo_geracao, fonte, potencia_outorgada_kw, latitude_decimal, longitude_decimal), coerces date columns to Date class, formats CNPJ with 14-digit padding, translates month names to English in CDE (january, february, etc.), coerces geracao_qualificada to integer, fixes typos and energy terminology in dictionary ("hydro" instead of "hydric"), and fixes accented “Condominio” matching in distributed generation. See tests/testthat/test-aneel-schema.R.
Fixed: when a server answered a download with an error page instead of the file (some do, with a normal “OK” status), the bad file was kept in the session’s download cache, so calling the function again in the same session failed the same way without downloading again. A download is now kept only once it has been read successfully; after a failure, the next call downloads again.
Fixed: with options(datazoom.amazonia.cache = FALSE), every download went into the session’s temporary folder itself, and the functions that find their file inside a zip by searching for it (load_sigmine(), load_ibama(dataset = "embargoed_areas"), load_aneel(dataset = "energy_enterprises_distributed"), and load_deter()’s fallback) could pick up a file another call had left there – for instance load_ibama() returning load_sigmine()’s data, with no error, after both ran in one session. Each download now gets its own folder whether the cache is on or off. With the cache on, a download that has to be repeated now starts from an empty folder, rather than unzipping over the files of the previous one.
Changed: load_prodes() now deletes, when it returns, only the temporary files terra wrote while processing that call (they can be large, as the raster is processed at full resolution). It used to delete all of terra’s temporary files at the start of each call (terra::tmpFiles(remove = TRUE)), including the ones behind any other SpatRaster the user had in the session, which then stopped working.
Fixed: load_prodes() could fail with Can't transform a data frame with duplicate names when called more than once in the same R session, or with options(datazoom.amazonia.cache = FALSE). It opened every .tif in its download folder, which with the cache off is the session’s temporary folder, so a raster left there by an earlier call (for instance a temporary file of terra’s that Windows had not let it delete) was read as a second layer. It now opens only the PRODES raster, by its exact name, and stops with a clear error if the download does not contain it.
Added: load_prodes() now checks the raster codes it uses against the legend (.qml) that INPE ships in the same zip as the raster, and warns if they disagree – a disagreement means the result may count the wrong pixels. It stays silent when the zip has no legend, and for "clouds" unless code 99 appears in the legend meaning something else (the 2025 legend has no entry for it). raw_data = TRUE is not affected.
Fixed: when the TerraClimate server cannot serve a load_climate() request – for instance a time_period entirely outside the available data – the function now stops with an error that says so and quotes the server’s own explanation, instead of failing with [rast] cannot open this file as a SpatRaster.
Changed: load_br_trade()’s four datasets ("export_mun", "import_mun", "export_prod", "import_prod") now download from balanca.mdic.gov.br, the host the ministry’s open-data page links to, instead of balanca.economia.gov.br, whose TLS certificate expired on 2026-10-03 (the files are the same). time_period now accepts 1997 to 2026 (it said 1997-2023); 2026 is a partial year – January to September as of 2026-10-17 – that the ministry rewrites every month. The two product-name dictionaries load_br_trade() also downloads (NCM.csv and NCM_SH.csv, byte-identical on both hosts) now come from the new host too, so load_br_trade() works again.
Fixed: load_pam() returned “Area destinada a colheita” (area set aside for harvest) for every permanent crop in a column called na_v<crop code> – na_v2720 for banana, 36 of permanent_crops’ 180 columns – because IBGE’s permanent-crops table reports it under an id the function had no name for. The column is now planted_to_harvest_area_v<crop code> (area_plantada_dest_colheita_v<crop code> with language = "pt"), the name all_crops already gives the same figure. Values and column labels are unchanged; the column now sits among its crop’s columns in alphabetical order, like the others, instead of last. Breaking for scripts that select the na_v<crop code> columns by name. If IBGE ever reports a variable the package has no name for, its columns are now called v<id>_v<crop code> and the call warns with IBGE’s own name for it, instead of silently producing na_v... columns.
Fixed: load_pam() stopped with object 'sidra_info' not found whenever dataset was given as a SIDRA table number, as its documentation allows. A table number is now the same call as the dataset that reads that table whole, with the same output: load_pam(dataset = 1612) is "temporary_crops", 1613 is "permanent_crops", 5457 is "all_crops", and 839, 1000, 1001 and 1002 are "corn", "peanut", "potato" and "beans". Any other number is sent to IBGE as it is and returns raw data only (raw_data = TRUE).
Fixed: load_pam() could stop with Error in Download. for the datasets that read a whole SIDRA table – "all_crops", "temporary_crops", "permanent_crops", "beans", "corn", "peanut" and "potato" – on networks where IBGE answers an anti-bot page (HTTP 403) instead of the table description those datasets looked up first; the datasets for a single crop were not affected. They now ask IBGE for the same data without that lookup, and return the same columns.
Changed: load_pam()’s time_period ranges were two editions behind and are now taken from IBGE’s own data. load_pam() no longer warns Option time_period must be in ...-2023 for 2024 and 2025: most datasets now cover up to 2025, while "india_tea", "jute_fiber", "linen_seeds", "pea", "quince", "ramie_fiber", "rye" and "tung" end in 2024. "annatto_seeds" starts in 1988, not 1981: IBGE publishes nothing for it before then, so requests for 1981-1987 used to return no data without saying why and now warn. The four series that ended in 1987 ("alfafa", "cashew", "forage_cane", "rubber_liquid_latex") are unchanged.
Fixed: load_pevs() could stop with Error in Download. for all three of its datasets ("pevs_forest_crops", "pevs_silviculture" and "pevs_silviculture_area") on networks where IBGE answers an anti-bot page (HTTP 403) instead of the table description the function used to look up first (checked 2026-10-31: all 12 tries, four per dataset, failed that way at the state level, for 2023). It now asks IBGE for the same data without that lookup, and returns the same columns and values: compared dataset by dataset at the country, region and state level, treated and raw, in both languages, for 2021 to 2024.
Fixed: load_pevs() gave the 2025 columns of "pevs_forest_crops" the label of the wrong product. IBGE’s 2025 data has ten products it did not report before, with codes 83410 to 83419, and the function attached labels by looking for the code of each product anywhere in a column’s name, so quant_v83410 (baru or cumaru almonds) was labelled “Umbu (fruit)”, quant_v83419 (murumuru) “Hevea (liquid latex)”, and so on: the label of the product whose code, 3410 to 3419, the new code contains. Labels are now matched on the exact code, and the 30 products IBGE added for 2025 (ten in "pevs_forest_crops", sixteen in "pevs_silviculture", four in "pevs_silviculture_area") are named in both languages. The values were never affected. Their English names are the package’s own glosses of IBGE’s Portuguese ones.
Fixed: load_pevs() stopped with object 'harmonization_dat' not found whenever dataset was given as a SIDRA table number, as its documentation allows, even when the download worked. A table number is now the same call as the dataset that reads that table: load_pevs(dataset = 289) is "pevs_forest_crops", 291 is "pevs_silviculture" and 5930 is "pevs_silviculture_area". Any other number is still sent to IBGE as it is and returns raw data only (raw_data = TRUE).
Changed: load_pevs()’s time_period ranges were two editions behind and are now taken from IBGE’s own data: 1986 to 2025 for "pevs_forest_crops" and "pevs_silviculture", 2013 to 2025 for "pevs_silviculture_area", which ended in 2023. load_pevs() no longer warns Option time_period must be in ...-2023 for 2024 and 2025. If IBGE ever reports a variable the package has no name for, its columns are now called v<id>_v<category code> and the call warns with IBGE’s own name for it, instead of silently producing na_v<category code> columns.
Fixed: load_population() could stop with Error in Download. on networks where IBGE answers an anti-bot page (HTTP 403) instead of the table description the function used to look up first (checked 2026-11-12: it failed that way for every year tried except 2010, which already spelled out a classification – 2007, 2015, 2022, 2023 and 2025 at the country level, 2015 at the state level). Three of the four tables it reads have no classification, so there was nothing to look up (the fourth, the 2010 census, already named the one it needs), and it now asks IBGE for the same data without that lookup, and returns the same columns and values: compared at the country and state level, treated and raw, in both languages, for 2007, 2010, 2015 and 2024, and at the municipality level for 2007 and 2010.
Fixed: load_population(time_period = 2022) did not work. IBGE publishes 2022, the year of the Census, in a table of its own that the function did not know, and the estimates table it fell back to has no 2022: at the country and state level the call stopped with Error in Download. and at the municipality level it returned an empty table without saying anything. 2022 now comes from the Census table, as 2007 (Contagem da Populacao) and 2010 (Censo Demografico) always have, and has the same single column of resident population, population_v93 (populacao_residente_v93 with language = "pt"). The Census table also reports the area and the density of each place; they are left out, as they are not in 2007 or 2010.
Changed: load_population()’s time_period range was behind and is now taken from IBGE’s own data: 2001 to 2022 and 2024 to 2026, with no 2023 (IBGE published no estimate between the 2022 Census and the 2024 estimates, so asking for 2023 still stops with Error in Download., after a warning that now lists the available years). load_population() no longer warns Option time_period must be in 2001-2021 for 2022 and for 2024 to 2026, for which the estimates were already returned.
Fixed: load_degrad() failed with arguments have different crs whenever time_period spanned years whose raw files use different coordinate systems – 2009:2010, 2014:2015 or 2007:2016, for example. The raw files carry no CRS at all for 2007-2009, SAD69 for 2010-2014 and SIRGAS 2000 for 2015-2016, so only ranges inside one of those three groups worked. Every year is now converted to SIRGAS 2000 before the years are combined: any time_period within 2007-2016 works and returns exactly what loading the years one at a time returns. This conversion also applies the real SAD69 -> SIRGAS 2000 datum shift to the 2007-2014 polygons, which the projection used internally never did, so those polygons move by about 60 to 75 m (2015-2016 are unchanged). Total area changes by under 0.003% a year, but per-municipality totals can move (median 0.004-0.1% a year; the largest moves, up to about 15%, are on municipalities with only 1.5-4 km2 of DEGRAD that year), the number of output rows changes by -14 to +3 per year, and 7 municipality-year pairs holding 0.03 km2 in total appear or disappear. raw_data = TRUE is unchanged and still returns each year’s own CRS. Note that date exists only from 2010 (the 2007-2009 raw files carry no view_date): it is absent when loading those years alone and NA for them in a multi-year result.
Changed: load_degrad()’s hardcoded CRS (operation_crs, used to reproject both the DEGRAD polygons and the Legal Amazon municipality boundaries before overlaying them and computing area) was the identical wrong string independently found and fixed in load_deter() on a separate branch (2026-10-08) – a near-copy of EPSG:5880 (“SIRGAS 2000 / Brazil Polyconic,” general-purpose, not equal-area) with its ellipsoid mistyped to a legacy, unrelated PROJ preset (“aust_SA”). Replaced with the same projection IBGE itself uses to compute official area figures (its “Projecao Conica Equivalente de Albers,” SIRGAS 2000 datum/GRS80 ellipsoid, central meridian -54 – see IBGE’s “Malha Municipal Digital e Areas Territoriais 2024,” Notas metodologicas 01/2025, Apendice B). As with DETER, the old string never misaligned DEGRAD polygons and municipalities (both inputs go through the same transform), it only inflated the area column (still square metres) the further a polygon sits from longitude -54. Measured 2026-10-12 on the 10 years loaded one at a time, old vs. new: +0.41% in total (+0.30% to +0.74% by year); by longitude, about +4.7% west of -70 degrees, +2.5% between -70 and -65, +1.0% between -65 and -60, +0.2% and +0.06% between -60 and -50, +0.7% between -50 and -45 and +1.4% east of -45 (the largest share of DEGRAD area, about 47%, lies between -55 and -50, where the bias is smallest, hence the small total). The new area matches an independent ellipsoidal geodesic area (lwgeom, GRS80) and a Lambert equal-area one to within 0.001% for 98% of rows in every year. The output differs by -1 to +6 boundary-sliver rows per year (+6 over the 10 years, out of 231,483) and no municipality appears or disappears.
Changed: load_deter() now computes its area column in IBGE’s own equal-area projection – Albers, SIRGAS 2000/GRS80, central meridian -54, latitude of origin -12, standard parallels -2/-22, false origin 5,000,000/10,000,000 (IBGE, Malha Municipal Digital e Areas Territoriais 2024, Notas metodologicas 01/2025, Apendice B, p. 20-21) – instead of the hardcoded +proj=poly ... +ellps=aust_SA string it used before, which turned out to be IBGE’s OTHER published Brazil-wide projection (the non-equal-area SIRGAS 2000 / Brazil Polyconic, meant for general mapping, not area calculations), with its ellipsoid mistyped on top of that to an unrelated legacy PROJ preset. Measured 2026-10-08 on identical downloads, old vs. new total area: +0.14% for "deter_pantanal", +0.51% for "deter_non_forest", +0.45% for "deter_amz" and +0.85% for "deter_cerrado"; by alert longitude about +4-5% west of -70 degrees, +2-3% near -67, +1.5% east of -45. The new area agrees with an independent ellipsoidal geodesic area (lwgeom, GRS80): median ratio 1.00000 in every longitude band, and 98% of rows within 0.001%. Alerts and municipalities were always correctly aligned to each other (both inputs went through the same, if wrong, transform), so this does not change which municipality an alert is assigned to beyond a few dozen boundary-sliver rows (under 2 km2 total – see the st_intersection() note below for exact counts). R/degrad.R has the identical hardcoded CRS string for its own area calculation; not changed here, a separate task. EPSG:10857/10856 (“SIRGAS 2000 / Brazil Albers”, registered 2025) encode the same parameters but resolve to NA (not an error) on at least one tested PROJ/sf install – the proj4 string is used directly instead for that reason.
Fixed: load_baci() stopped, after downloading the BACI archive, with a TLS certificate error while reading its product-code dictionary: that table (NCM_SH.csv, the Brazilian COMEX HS dictionary) was fetched from balanca.economia.gov.br, whose certificate expired on 2026-10-03. It now comes from balanca.mdic.gov.br, the host the ministry’s open-data page links to (the same file, byte-identical). raw_data = TRUE, which skips the dictionary, was not affected. (On Linux that host needs one more workaround; see the next entry.)
Fixed: load_br_trade() and load_baci() failed on Linux – and on any system whose TLS library does not look up missing intermediate certificates – with SSL certificate problem: unable to get local issuer certificate, when reading COMEX’s data (load_br_trade()) or its product dictionary (both; for load_baci() only after the multi-GB BACI download). The COMEX server (balanca.mdic.gov.br) sends its own certificate but not the intermediate certificate that issued it (“AC SERPRO AR46 OV TLS CA 2025”); Windows fetches that itself (and so do browsers), OpenSSL does not (macOS was not tested), and the standard Ubuntu 22.04 and 24.04 certificate bundles do not contain it. When the first attempt fails with a certificate error, the package now repeats it once, for that one server only, trusting the certificate chain bundled with it (GlobalSign Root R46, which is in the standard CA stores, and SERPRO’s intermediate; both are public CA certificates). Certificate verification is never turned off: the server’s certificate must still chain to that root and match the host name, and the bundle rejects every other host. Systems that could already verify the server never use the bundle. If SERPRO changes its intermediate certificate the bundle needs a package update, and the error says so. The package now lists curl in Imports (it was already installed, as a dependency of googledrive).
Fixed: load_ppm() could stop with Error in Download. for all five of its datasets ("ppm_livestock_inventory", "ppm_sheep_farming", "ppm_animal_origin_production", "ppm_cow_farming" and "ppm_aquaculture") on networks where IBGE answers an anti-bot page (HTTP 403) instead of the table description the function used to look up first. It now asks IBGE for the same data without that lookup, and returns the same columns and values: compared dataset by dataset at the country and state level, and for two of them at the municipality level. The same goes for a dataset given as its SIDRA table number, as the documentation allows: load_ppm(dataset = 94) is now the same call as load_ppm(dataset = "ppm_cow_farming"), and likewise 74, 95, 3939 and 3940. Before, a table number always took the lookup that fails, and with raw_data = FALSE it stopped with object 'harmonization_dat' not found even when the download worked; any other number still returns raw data only.
Changed: load_ppm()’s time_period ranges were two editions behind and are now taken from IBGE’s own data. load_ppm() no longer warns Option time_period must be in 1974-2023 (2013-2023 for "ppm_aquaculture") for 2024 and 2025, which IBGE has published for all five datasets. The start years are unchanged.
Fixed: load_pibmunic() could stop with Error in Download. on networks where IBGE answers an anti-bot page (HTTP 403) instead of the table description the function used to look up first (checked 2026-10-30: it failed that way at the country and state level, for 2021). Table 5938 has no classification, so the function now asks IBGE for the same data without that lookup, and returns the same columns and values: compared at the country and state level, treated and raw, in both languages, for 2021 to 2023.
Fixed: load_pibmunic() stopped with object 'harmonization_dat' not found whenever dataset was given as a SIDRA table number, as its documentation allows, even when the download worked. load_pibmunic(dataset = 5938) is now the same call as load_pibmunic(dataset = "pibmunic"), with the same output; any other number is still sent to IBGE as it is and returns raw data only (raw_data = TRUE).
Changed: load_pibmunic()’s time_period range was two editions behind and is now taken from IBGE’s own data: 2002 to 2023, not 2002 to 2021. load_pibmunic() no longer warns Option time_period must be in 2002-2021 for 2022 and 2023. For those two years IBGE’s table currently has only GDP at current prices and its shares in the GDP of larger areas (Brazil, region, state, meso- and micro-region); taxes and value added, in total and by activity, and their shares stop at 2021. With time_period = 2022:2023 the result has only those columns, and with a range that also includes earlier years the other columns are NA for 2022 and 2023.
Added two new datasets to load_deter(): "deter_pantanal" (Pantanal biome deforestation alerts, 2023-2026) and "deter_non_forest" (non-forest-area alerts within the Legal Amazon, 2023-2026), alongside the already-supported "deter_amz"/"deter_cerrado".
Fixed: load_deter() silently dropped alert_type for "deter_pantanal"/"deter_non_forest" – these two datasets ship their class column under a different raw name than "deter_amz"/"deter_cerrado" do, so it was silently kept out of the output instead of appearing. All 4 datasets now return alert_type. Separately, worth knowing: the municipality overlay can split an alert across more than one output row near a municipality boundary (use alert_id, not row count, to reconcile) and drops a very small number of alerts outright – measured 2026-10-08: 16 of deter_amz’s 461,071 raw alerts, 6 of deter_cerrado’s 134,165, 2 of deter_pantanal’s 24,155, 0 for deter_non_forest.
Fixed: load_climate() failed for every variable in release 1.2.0, with [rast] cannot open this file as a SpatRaster. The Climatology Lab replaced the original TerraClimate dataset (v1.0, starting in 1958) with v1.1 (starting in 1950), and its server no longer serves the old file – but it answers a request for it with HTTP 200 and an empty body instead of an error, so the download looked successful and the failure only surfaced when the empty file was read. load_climate() now requests the v1.1 file. v1.1 is built on ERA5 (v1.0 used CRU and JRA-55) and the lab advises against mixing the two versions; it also notes that the first year, 1950, is affected by the water-balance model’s spin-up. The supported time_period is now 1950-2025 instead of the 1958-2022 the package used to declare: load_climate() no longer warns Option time_period must be in 1958-2022 for 2023-2025 (which were always available), and 1950-1957 are accepted.
Fixed: energy_enterprises_distributed’s dictionary (R/dictionary.R) had a completely stale dsc_modalidade_habilitado group – all 4 of its old var_codes ("Com Microgeracao ou Minigeracao distribuida", "Caracterizada como Autoconsumo remoto", …) were long descriptive strings matching zero real values; the source now uses the same short codes (Geracao na propria UC/Auto consumo remoto/Compartilhada/Condominio) R/aneel.R’s separate case_when() block already expects for its own, different business_type column, so business_type_description (the dictionary-driven one) was passing every value through completely untranslated in both pt and eng. dsc_classe_consumo and dsc_fonte_geracao were correct as far as they went but incomplete (missing Comercial/Consumo Proprio/Industrial/Rural and Etanol/Oleo Diesel/Oleos vegetais respectively). Verified live against the real ~4.66M-row empreendimento-geracao-distribuida.csv: every real value in all 4 groups now translates correctly except dsc_classe_consumo’s "REBR"/"REBR " (two variants, one with a trailing space, in ANEEL’s own data) – left untranslated, no documented meaning found. See tests/testthat/test-aneel-schema.R.
Fixed: energy_development_budget’s dictionary (R/dictionary.R) had 17 "tipo_de_despesa" rows (CAFT CCEE, Programa Luz para Todos, Subsidio Baixa Renda, …) that never matched any real column – the manifest’s current resource (cde-beneficiarios-rede-basica-*.csv, a per-agent “Rede Basica” tariff-subsidy beneficiary listing) has no expense-by-category dimension at all; "tipo_de_despesa" doesn’t exist as a column in it. Checked against a locally saved copy of the real 2023 file (dadosabertos.aneel.gov.br was unreachable at investigation time – TLS handshake failing across curl, httr, and utils::download.file() alike, most likely a rate-limit from this session’s own heavy traffic). Dropped the 17 dead rows rather than keep them as dead weight describing a dimension the current data doesn’t have (same “don’t collapse or preserve a category that isn’t really there” principle as the manifest-maintenance skill’s schema-migration rule) – if ANEEL’s catalogue turns out to still carry a separate expense-by-category CDE resource, that’s a new dataset/variable to add, not something to fold back into this one. Replaced with the one column that has an unambiguous, verified value: dsc_grupo_tarifario is always "Rede Basica" in the real data, now translated to "rede_basica"/"basic_network". idc_classe_consumidor (real values: 9, 10) and idc_tipo (real values: 7, 8) are bare ANEEL indicator codes with no documented meaning found – deliberately left untranslated at the value level (their column names are still translated, via the eng rename map fixed below). Matching "tipo_de_despesa" = "type_of_expense" rename-map entry also removed. See tests/testthat/test-aneel-schema.R.
Fixed: load_aneel(..., language = "eng")’s column-renaming map (R/aneel.R) was stale for energy_generation and energy_development_budget – about half of energy_generation’s real columns and all but two of energy_development_budget’s stayed in raw Portuguese snake_case in eng output instead of getting English names, because the map’s keys were written for a column-naming convention that doesn’t match either dataset’s real janitor::clean_names() output today (same root cause, and largely the same wrong keys, as the energy_generation dictionary mismatch fixed above – "fase"/"origem"/"tipo"/"geracao_qualificada"/"inicio_vigencia"/"fim_vigencia"/"proprietario_regime_de_exploracao"/"sub_bacia"/"municipio_s"/"entrada_em_operacao" never matched real columns; real ones are dsc_fase_usina/dsc_origem_combustivel/dsc_fonte_combustivel/idc_geracao_qualificada/dat_inicio_vigencia/dat_fim_vigencia/dsc_propri_regime_pariticipacao/dsc_sub_bacia/dsc_muninicpios/dat_entrada_operacao, the last two carrying ANEEL’s own typos). Fixed the mismatched keys and added the map entries these two datasets were missing entirely (nom_empreendimento, mda_potencia_outorgada_kw, num_ano, vlr_desconto, etc.) – verified live: every real column in both datasets now gets an English name in eng mode, no duplicates. Also removed a dead as.Date(operation_start, format = "%d/%m/%Y") step that had matched zero columns in any of the three datasets since it was written (nothing is ever literally named operation_start pre-rename) – moot anyway, since energy_generation’s real date column (dat_entrada_operacao) turns out to already be IDate/Date straight out of fread(). fragility-notes test’s min_tags for R/aneel.R dropped from 5 to 4 accordingly. energy_development_budget’s dictionary ("tipo_de_despesa") was left as a documented, unfixed gap when this entry was first written – see the entry below for how it was resolved.
Fixed: aneel was excluded from the session-scoped file download cache (R/download.R’s use_cache <- download_cache_enabled() && source != "aneel", added in a 2026-09-18 merge commit as “per maintainer decision”), so every load_aneel() call re-downloaded its file from scratch even within the same R session, back-to-back. That exclusion’s real justification (a shared, mutable-by-reference data.table::fread() result being unsafe to reuse under raw_data = TRUE) belongs to the separate, already-correctly-scoped parsed-object cache (parsed_cache_eligible(), .xlsx reads only – aneel was never in it) – the file-level cache just remembers a download’s disk location and shares no object, so there was no actual risk to guard against. Removed the source != "aneel" exclusion; the parsed-object cache exclusion is untouched. Verified live: a second load_aneel() call for the same dataset in one session no longer re-downloads (confirmed against energy_generation: 7.2s → 0.25s, no second network request). See tests/testthat/test-download-cache.R.
Fixed: load_aneel(dataset = "energy_enterprises_distributed") hard-errored on every real download (data.table::fread() handed the raw zip bytes directly – "string with embedded nul: 'PK\003\004...'", the zip magic number). R/download.R’s aneel branch hardcoded file_extension <- ".csv" for all three aneel datasets, but this one’s manifest URL is a real ~106MB zip (empreendimento-geracao-distribuida.zip, ~1.5GB uncompressed) – the unzip step (keyed on file_extension == ".zip") never ran. Predates the energy_generation migration above; traced to this dataset’s original commit (April 2023). Now sets file_extension <- ".zip" for this dataset specifically and reads the extracted CSV by pattern inside the existing .zip-handling dispatch, alongside sigmine/ibama’s shapefile-by-pattern precedent. Verified live: downloads and parses all ~4.66M rows.
Fixed: all three load_aneel() datasets were being read with the wrong fread() encoding argument. energy_enterprises_distributed and energy_development_budget used encoding = "Latin-1" (assumed since energy_enterprises_distributed‘s original commit, April 2023) with a follow-up iconv(from = "ISO-8859-1", to = "UTF-8") step in R/aneel.R meant to undo it – but live inspection of both sources’ raw bytes (2026-09-21) showed they’re genuinely UTF-8 (e.g. "Condomínio"/"Rede Básica" are real multi-byte UTF-8 sequences, not single-byte Latin-1 characters), so fread(encoding = "Latin-1") was misreading valid UTF-8 as Latin-1, producing mojibake (real "Condomínio" came through as "CondomÃnio") that no post-hoc iconv() could cleanly reverse. Both datasets now read encoding = "UTF-8" directly; the now-unnecessary iconv() step was removed from R/aneel.R. Also fixed alongside: vlr_desconto/vlr_cobranca (CDE discount/charge amounts, energy_development_budget) were never parsed to numeric at all – same root cause and same fix as energy_generation’s mda_*/num_coord_* gap below, generalized to a shared prefix list (mda/num_coord/vlr) covering all three datasets that need it.
Fixed: energy_generation’s dictionary-based PT/EN value recoding (R/dictionary.R, e.g. ANEEL’s "PCH" code → "pequena_central_hidreletrica"/"small_hydroelectric_center") was silently a no-op for the entire dataset. The dictionary’s ~variable column used short generic names ("fonte", "fase", "origem", "tipo", "tipo_de_atuacao", "combustivel_final", "geracao_qualificada") that never matched any real column name after janitor::clean_names() (real names: sig_tipo_geracao, dsc_fase_usina, etc.) – so every lookup silently matched zero rows and every raw ANEEL code passed straight through untranslated. Renamed all seven ~variable groups to the real column identifiers, verified live against the current CSV with zero mismatches in either direction (one dictionary sentinel, geracao_qualificada’s "-", doesn’t match the live data’s "" for the same case – left as-is, a separate pre-existing quirk). See tests/testthat/test-aneel-schema.R.
load_aneel(dataset = "energy_generation") (SIGA) moved off a dead GitLab-hosted xlsx (git.aneel.gov.br/.../BD_SIGA.xlsx, 403 Forbidden) onto ANEEL’s own CKAN Open Data catalogue, which now serves the same dataset as a CSV (siga-empreendimentos-geracao.csv) – same mechanism ANEEL’s other two datasets already use (resolve_aneel.R’s CKAN package_show JSON, not HTML scraping), so resolve_aneel.R now resolves all three ANEEL datasets instead of two; energy_generation’s manifest row gained a real resolver/url where it used to be permanently hand-maintained. R/download.R reads it via data.table::fread() instead of readxl::read_xlsx() (skip_rows/sheet no longer apply to this dataset). Fixed alongside: the switch to CSV meant mda_*/num_coord_* power and coordinate columns, which the old xlsx stored as real Excel numerics, now arrive as Brazilian-locale strings ("1400,00", "-20,12479858") the same way energy_enterprises_distributed’s CSV always has – the existing comma/thousand-separator cleaning step was scoped to energy_enterprises_distributed only and didn’t cover energy_generation’s new shape, which would have silently left those columns as character. Generalized to run for both datasets (guarded on is.character(), since fread() can already auto-parse a comma-free column as numeric on its own). aneel excluded from the session download+parse cache (all-CSV now, nothing left to cache) and given its first # FRAGILE: tags. See tests/testthat/test-aneel-schema.R.
resolve_seeg.R stopped being detect-only, and load_seeg() was rewritten sector by sector to read SEEG’s actual current file. Same story as IPS below: the resolver’s detect-only status rested on an assumption (“the live file has a different shape”) from when it was first written, never actually checked – checked live 2026-09-15, and the real file (seeg.eco.br’s municipal summary workbook) turned out to be a full schema restructuring, not a version bump: the old NIVEL 1..NIVEL 6 hierarchy is now Setor de emissão/Categoria emissora/Sub-categoria emissora/Recorte/Atividade geral, the year range widened from 2000-2018 to 1970-2024, and GÁS/PRODUTO are gone from this file entirely. All five load_seeg() sectors (seeg_farming, seeg_industry, seeg_energy, seeg_residuals, seeg_land) were migrated and verified live against the real ~250MB file (exact row counts, totals reconciled across municipality/state/country). Each sector lost some old granularity the new schema simply doesn’t carry – produto/gas, farming’s species/crop-level detail, industry’s technology-level detail, energy’s fuel-type breakdown, and (the largest loss) seeg_land’s entire biome dimension and its full origin-to-destination land-cover transition matrix, collapsed into four coarser fields. Every loss is tagged # FRAGILE: in R/seeg.R, dropped rather than reconstructed or force-fit into an old bucket. resolve_seeg.R now emits a real url, verified live on every run via a ranged GET of the candidate xlsx’s own xl/workbook.xml and xl/pivotCache/pivotCacheDefinition1.xml (an xlsx is a zip; reuses zip_remote_listing.R, which gained an optional useragent param since seeg.eco.br 403s any request without a browser-like one). RESOLVER_ALERT_SOURCES gained "seeg". See tests/testthat/test-seeg-*.R.
resolve_ips.R stopped being detect-only (it used to emit only version/docs_url, never url, on an assumption – that IPS Amazônia’s Strapi-hosted workbook is “a different shape” than R/ips.R’s expected 4-year-sheet layout – that was never actually checked). Checked live 2026-09-14: the two workbooks are a drop-in match (identical sheets, 772 rows/sheet, identical janitor-cleaned column names on all 4 year tabs), and the Strapi copy is the publisher’s own file. (The manifest’s old Google Drive link was confirmed owned by a personal gmail account, not Datazoom, and not in Datazoom’s shared Drive folder – a one-off personal upload that was never kept in sync with anything upstream.) All 8 IPS manifest rows now point at the real painel.ipsamazonia.org.br URL, re-verified every run via a ranged GET of the workbook’s own xl/workbook.xml (an xlsx is a zip; reuses zip_remote_listing.R) rather than trusted from that one-time comparison. load_ips()’s hardcoded sheet_list (and the "2018 " trailing-space workaround baked into it) is gone – years now come from the manifest’s available_time, and a new ips_match_sheets() (R/ips.R) resolves a requested year to the workbook’s own tab name by matching on the year digits, not the raw string, so a whitespace quirk (this one, or any future one) can’t break readxl::read_xlsx()’s exact-string sheet lookup. R/ips.R also gets its first # FRAGILE: tags (the hardcoded 2012:2023 year-strip range, the dplyr::contains() substring column match, the any_of() silently-tolerant pt/eng rename map) via a new row in fragility_notes.R’s FRAGILITY_SOURCES table. See tests/testthat/test-ips-sheets.R.
Fixed: PRODES’ docs_url (6 manifest rows) was pointing at a deforestation-rates dashboard app, not TerraBrasilis’ actual downloads landing page (https://terrabrasilis.dpi.inpe.br/downloads/).
load_mapbiomas moved from a mix of GCS-bucket and WordPress-hosted links to MapBiomas’s own Dataverse archive (data.mapbiomas.org) – a documented REST API with permanent DOIs and versioned files, discovered to be genuinely ahead of both previous sources (fixes long-dead "mapbiomas_mining" and "mapbiomas_water" downloads, and picks up Collection 10/10.1 data neither previous source had mirrored). Added a new dataset, "mapbiomas_secondary_vegetation" – Collection 10 split what used to be one combined deforestation+regeneration file into two separate ones; "mapbiomas_deforestation_regeneration" now covers only the deforestation half. Three geo_level rows are deliberately pinned to an older Dataverse collection than their siblings where a newer one is missing a needed sheet (most notably "mapbiomas_mining"’s indigenous-lands data, one collection behind its municipality-level sibling) – not a bug, a discovered gap in what MapBiomas itself has republished.
Fixed load_mapbiomas()’s treatment code, which the Dataverse migration above changed the links for but not the parsing of – Collection 10 didn’t just re-host Collection 9’s workbooks, it restructured several of them. Concretely this fixed: "mapbiomas_cover" (both geo_levels) and "mapbiomas_water"/"biome" hard-erroring (a state/state_acronym column collision on cover, a wide-shaped water/biome sheet the old code assumed was already long); "mapbiomas_transition"/"biome" hard-erroring (its window columns are now p-prefixed, e.g. p1985_1986, not x-prefixed); and "mapbiomas_deforestation_regeneration"’s municipality code silently not renaming (the source renamed geocode to geocode_municipality). Also fixed a related manifest bug: "mapbiomas_cover"/"municipality" was pointed at a Dataverse file (Collection 10.1) that has no municipality-code column in any sheet at all – the resolver’s own newest-collection-first walk now also verifies a candidate’s columns, not just its sheet name, so it lands on Dataverse’s plain Collection 10 dataset instead (same file MapBiomas also serves off GCS) and will self-heal onto a newer collection automatically once one restores the column, no code change needed. See R/mapbiomas.R’s mapbiomas_treat() and actions/scrapers/resolve_mapbiomas.R’s dv_file_layout().
load_epe(dataset = "national_energy_balance")’s source changed from EPE’s old one-workbook-per-edition SharePoint file (2003-2023, one sheet per year, reconstructed into long format by hand) to EPE’s own consolidated BEN table, which is already long-format and covers 1970-2025. Breaking for raw_data = TRUE: this now returns a list of one tibble instead of one tibble per year. Account (conta/account) labels also changed from a synthetic uppercase reconstruction (e.g. "TRANSFORMACAO - REFINARIAS DE PETROLEO") to the source’s own labels (e.g. "Refinarias de Petróleo"), and a new tipo/type column (Fontes de Energia Primária/Secundária/Total) is now available, previously implicit and unrecoverable from the old workbook’s column headers.
load_epe(dataset = "energy_state_panel")’s source URL, found discontinued below, now has a replacement: EPE’s BEN dashboard (the same book national_energy_balance reads) publishes a consolidated, already-tidy generation-by-source table on its Chapter 8 page (tabela_geracao_eletricidade_por_fonte.xlsx, long-format, 2011-2025, up from 2011-2024). The 16 fonte values it uses map 1:1 onto this dataset’s existing columns; R/epe.R now reads it long and pivots it instead of parsing the old sheet’s "ANO BASE XXXX" block structure. Not breaking for callers – both raw and treated output keep the same shape and column names as before, including raw_data = TRUE (still one tibble). One cosmetic fix: 3 state names ("Mato Grosso do Sul", "Rio Grande do Sul", "Rio Grande do Norte") are normalized to their standard lowercase connector, matching the old source’s convention – the new source capitalizes it ("Mato Grosso Do Sul").
load_epe(dataset = "energy_state_panel")’s OLD source URL was found to be discontinued (EPE restructured its “Anuário Estatístico” from 8+ chapters to 4; no current publication has the same state x generation-source breakdown) – see the fix directly above.
Refreshed the CI resolvers (actions/scrapers/) for PRODES, EPE and (new, detect-only) SEEG/IPS – resolve_prodes.R and resolve_epe.R were previously documented no-ops. build_manifest.R gained a --check-all flag that reports every broken manifest URL (not just recently-changed ones) without failing the run, so long-standing breaks like the one above stay visible.
Added "energy_state_panel" dataset to load_epe: yearly energy production by source and state (2011-2024), from EPE’s BEN Chapter 8 (Dados Estaduais).
Deprecated load_datasus(). All its datasets were moved to a new package: datazoom.saude. Beta version available.
Updated load_mapbiomas to the Collection 9 data, with both new and reformed datasets
Many small bug fixes
load_prodes now reads the full raster data from PRODESUpdated download.R to read the data now available at the EPE website.
Updated load_epe which has now 3 parameters following the split of energy_consumption_per_class in industrial_energy_consumption and consumer_energy_consumption.
Added support for four new SIH datasets in the load_datasus() function
load_mapbiomas to download the newest Mapbiomas Collections and to warn about the currently unavailable download URL of the datasets water and irrigation. Also added the Indigenous Lands option to the "mapbiomas_cover" dataset.load_baci to support the newest version of the data, fixing the previous broken download URL. (Thanks to @OlivazShai)load_prodes data cleaning and download to allow more recent dataAdded a citation template for work using the package
Added the "energy_enterprises_distributed" dataset to load_aneel
Updated load_mapbiomas to the Collection 8 data, with both new and reformed datasets
Added the load_population function with Brazilian population data and estimates
Added the load_censoagro function with data from the Census of Agriculture
Updated load_ips to include 2023 data
Removed the load_cipo function
Many small bug fixes
Adding new load_epe function for EPE data and adding new load_aneel function for ANEEL data
Changing the internal structure of download.R, which is behind all functions
load_ibama for environmental distributed and collected finesNEWS.md file to track changes to the package.