| Type: | Package |
| Title: | Import Brazilian Real Estate Data into R |
| Version: | 1.0.1 |
| Description: | Provides access to Brazilian real estate market data from multiple official sources: the Central Bank of Brazil (BCB), the Brazilian Association of Real Estate Developers (ABRAINC), the Brazilian Association of Real Estate Credit and Savings Entities (ABECIP), the Getulio Vargas Foundation (FGV), and the Bank for International Settlements (BIS). |
| License: | MIT + file LICENSE |
| URL: | https://github.com/viniciusoike/realestatebr, https://viniciusoike.github.io/realestatebr/ |
| BugReports: | https://github.com/viniciusoike/realestatebr/issues |
| Encoding: | UTF-8 |
| Language: | en-US |
| LazyData: | true |
| Depends: | R (≥ 4.1.0) |
| RoxygenNote: | 7.3.3 |
| Imports: | cli, dplyr, httr, janitor, lubridate, purrr, rbcb, readr, readxl, rlang, rvest, stringr, tibble, tidyr, tidyxl, xml2, yaml, zoo |
| Suggests: | geobr, ggplot2, kableExtra, knitr, pkgdown, RcppRoll, rmarkdown, scales, sf, stringi, targets, tarchetypes, testthat, trendseries |
| VignetteBuilder: | knitr |
| NeedsCompilation: | no |
| Packaged: | 2026-06-05 12:12:40 UTC; viniciusreginatto |
| Author: | Vinicius Oike Reginatto [aut, cre, cph] |
| Maintainer: | Vinicius Oike Reginatto <viniciusoike@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-06-05 16:10:02 UTC |
realestatebr: Import Brazilian Real Estate Data into R
Description
Provides access to Brazilian real estate market data from multiple official sources: the Central Bank of Brazil (BCB), the Brazilian Association of Real Estate Developers (ABRAINC), the Brazilian Association of Real Estate Credit and Savings Entities (ABECIP), the Getulio Vargas Foundation (FGV), and the Bank for International Settlements (BIS).
Author(s)
Maintainer: Vinicius Oike Reginatto viniciusoike@gmail.com [copyright holder]
See Also
Useful links:
Report bugs at https://github.com/viniciusoike/realestatebr/issues
Character mappings for consistent encoding
Description
Maps ASCII-key identifiers to their UTF-8 Portuguese equivalents.
Keys are kept as plain ASCII for easy programmatic lookup; values
are UTF-8 strings as supported by Encoding: UTF-8 in DESCRIPTION.
Usage
.ENCODING_MAP
Format
An object of class list of length 13.
Clean a Single SBPE-Format Table
Description
Clean a Single SBPE-Format Table
Usage
abecip_clean_sbpe_table(df)
Arguments
df |
Raw data frame from Excel import |
Value
Cleaned tibble
Apply Table Filtering to Loaded Dataset
Description
Apply Table Filtering to Loaded Dataset
Usage
apply_table_filtering(data, name, table)
Attach Standard Metadata to Dataset
Description
Attaches standardized metadata attributes to a dataset. Consolidates metadata attachment logic used across all dataset functions.
Usage
attach_dataset_metadata(
data,
source = c("web", "github", "bundled"),
category = NULL,
extra_info = list()
)
Arguments
data |
Data frame or tibble. The dataset to attach metadata to. |
source |
Character. Data source: |
category |
Character or NULL. Dataset category/table name. |
extra_info |
List. Additional metadata to include in download_info. |
Value
The data with metadata attributes attached.
Real Estate Players listed on B3
Description
List of main Brazilian real estate players listed on B3.
Usage
b3_real_estate
Format
b3_real_estate
A tibble with 38 rows and 3 columns:
- symbol
Stock ticker.
- name
Full company name.
- name_short
A shorter version of the company name.
Source
B3
Brazilian Central Bank Series Metadata
Description
A table with metadata for BCB economic series. Use with get_dataset("bcb_series").
The hierarchy column controls which series are returned by default: pass
table = "core" for the most relevant real estate series, or a broader
level for more macroeconomic context (see get_dataset).
Usage
bcb_metadata
Format
bcb_metadata
A data frame with 140 rows and 11 columns:
- code_bcb
Numeric code identifying the series.
- bcb_category
Category of the series.
- name_simplified
Simplified name of the series.
- name_pt
Full name of the series in Portuguese.
- name
Full name of the series in English.
- unit
Unit of the series.
- frequency
Frequency of the series.
- first_value
Date of the first available observation.
- last_value
Date of the last available observation.
- source
Source of the series.
- hierarchy
Integer relevance tier: 1 = core real estate credit series; 2 = primary (key macro series such as SELIC, IPCA, INCC); 3 = secondary (broader macro context); 4 = tertiary (less relevant or discontinued series).
Source
Brazilian Central Bank (BCB)
Clean SBPE Data from Abecip Excel File
Description
Clean SBPE Data from Abecip Excel File
Usage
clean_abecip_sbpe(temp_path)
Arguments
temp_path |
Path to the downloaded Excel file |
Value
A tibble with processed SBPE data
Clean Units Data from Abecip Excel File
Description
Clean Units Data from Abecip Excel File
Usage
clean_abecip_units(temp_path)
Arguments
temp_path |
Path to the downloaded Excel file |
Value
A tibble with processed units data
Process BIS Detailed CSV Data
Description
Reads the flat CSV, parses compound columns, then splits by frequency with appropriate date parsing for each.
Usage
clean_bis_detailed(csv_path, quiet)
Arguments
csv_path |
Path to the extracted CSV file |
quiet |
Logical controlling messages |
Value
Named list with elements: monthly, quarterly, annual, halfyearly
Clean BIS Selected CSV Data
Description
Reads the column-oriented CSV from the BIS SPP dataset, pivots date columns to long format, and standardises column names.
Usage
clean_bis_selected(csv_path, quiet)
Arguments
csv_path |
Path to the extracted CSV file |
quiet |
Logical controlling messages |
Value
Processed BIS selected data tibble
Clear the In-Session Dataset Memo
Description
Drops every dataset memoised during the current R session. Useful when iterating during development or to force re-fetch without restarting R.
Usage
clear_session_cache()
Value
NULL, invisibly.
Examples
clear_session_cache()
Debug-Level Messaging
Description
Displays informational messages only when debug mode is enabled.
This function is a wrapper around cli::cli_inform() that respects
the debug mode setting.
Usage
cli_debug(message, ...)
Arguments
message |
Character string. The message to display. |
... |
Additional arguments passed to |
Details
This function should be used for detailed processing messages that are
useful for development and debugging but would be too verbose for
end-users. Messages are only shown when debug mode is enabled via
is_debug_mode().
See Also
User-Level Messaging
Description
Displays concise informational messages for end-users. This function shows a simplified, clean message unless the user has requested verbose output via the quiet parameter.
Usage
cli_user(message, quiet = FALSE, ...)
Arguments
message |
Character string. The message to display. |
quiet |
Logical. If TRUE, suppresses the message. |
... |
Additional arguments passed to |
Details
This function should be used for essential status messages that provide value to end-users, such as final results or major milestones. The message is shown unless explicitly suppressed by quiet=TRUE.
Brazilian city identifier table
Description
A table with official IBGE identifiers for all Brazilian cities.
Usage
dim_city
Format
An object of class tbl_df (inherits from tbl, data.frame) with 5570 rows and 9 columns.
Details
A tibble with 5,570 rows and 8 columns:
- code_muni
7-digit IBGE code identifying the city.
- name_muni
Name of the city.
- code_state
2-digit IBGE code identifying the state.
- name_state
Name of the state.
- code_region
1-digit IBGE code identifying the region
- name_region
Name of the region
- name_simplified
Simplified version of the city name for easier subsetting.
Source
IBGE (Brazilian Institute of Geography and Statistics)
Download Abecip Excel File
Description
Scrapes the given page to find the download link, then downloads the Excel
file using the shared download_excel() helper.
Usage
download_abecip_file(
url_page,
xpath,
file_prefix,
quiet = FALSE,
max_retries = 3L
)
Arguments
url_page |
URL of the Abecip page containing the download link |
xpath |
XPath to locate the download link |
file_prefix |
Prefix used in retry-attempt messages |
quiet |
Logical controlling messages |
max_retries |
Maximum number of retry attempts |
Value
Path to the downloaded temporary file
Download SBPE Excel File from Abecip
Description
Download SBPE Excel File from Abecip
Usage
download_abecip_sbpe(quiet = FALSE, max_retries = 3L)
Arguments
quiet |
Logical controlling progress messages |
max_retries |
Maximum number of retry attempts |
Value
Path to the downloaded temporary file
Download Units Excel File from Abecip
Description
Download Units Excel File from Abecip
Usage
download_abecip_units(quiet = FALSE, max_retries = 3L)
Arguments
quiet |
Logical controlling progress messages |
max_retries |
Maximum number of retry attempts |
Value
Path to the downloaded temporary file
Download raw BCB real estate data from the API
Description
Download raw BCB real estate data from the API
Usage
download_bcb_realestate(quiet = FALSE, max_retries = 3L)
Arguments
quiet |
Logical controlling messages |
max_retries |
Maximum number of retry attempts |
Value
Raw tibble from BCB API endpoint
Download BCB Series Data with Robust Error Handling
Description
Downloads BCB series data with per-series retry logic. Uses
purrr::possibly() to collect failures without aborting, then reports
any failed series after the full map completes.
Usage
download_bcb_series(codes_bcb, date_start, quiet, max_retries, ...)
Arguments
codes_bcb |
Vector of BCB series codes. |
date_start |
Start date for series. |
quiet |
Logical controlling messages. |
max_retries |
Maximum number of retry attempts per series. |
... |
Additional arguments passed to |
Value
A long-format tibble with columns date, value, and code_bcb.
Download BIS RPPI Detailed ZIP
Description
Download BIS RPPI Detailed ZIP
Usage
download_bis_detailed(quiet, max_retries)
Arguments
quiet |
Logical controlling messages |
max_retries |
Maximum number of retry attempts |
Value
Path to extracted CSV file
Download BIS RPPI Selected ZIP
Description
Download BIS RPPI Selected ZIP
Usage
download_bis_selected(quiet, max_retries)
Arguments
quiet |
Logical controlling messages |
max_retries |
Maximum number of retry attempts |
Value
Path to extracted CSV file
Download CSV File
Description
Downloads a CSV file to a temporary location with retry logic.
Usage
download_csv(
url,
min_size = 100,
ssl_verify = TRUE,
max_retries = 3,
quiet = FALSE
)
Arguments
url |
Character. URL of the CSV file. |
min_size |
Integer. Minimum file size in bytes. Default 100. |
ssl_verify |
Logical. Whether to verify SSL certificates. |
max_retries |
Integer. Number of retry attempts. |
quiet |
Logical. Suppress progress messages. |
Value
Character. Path to downloaded CSV file.
Download and Validate Excel File
Description
Downloads an Excel file with validation of expected sheets and file size.
Usage
download_excel(
url,
expected_sheets = NULL,
min_size = 1000,
ssl_verify = TRUE,
max_retries = 3,
quiet = FALSE
)
Arguments
url |
Character. URL of the Excel file. |
expected_sheets |
Character vector. Sheet names that must be present. If NULL, no sheet validation is performed. |
min_size |
Integer. Minimum file size in bytes. Default 1000. |
ssl_verify |
Logical. Whether to verify SSL certificates. |
max_retries |
Integer. Number of retry attempts. |
quiet |
Logical. Suppress progress messages. |
Value
Character. Path to downloaded and validated Excel file.
Download raw SECOVI-SP indicator tables
Description
Download raw SECOVI-SP indicator tables
Usage
download_secovi(table, quiet, max_retries)
Arguments
table |
Data table to import |
quiet |
Logical controlling messages |
max_retries |
Maximum number of retry attempts |
Value
Named list of scraped data tables
Download with Retry Logic
Description
Executes a download function with automatic retry on failure. Uses exponential backoff between retry attempts.
Usage
download_with_retry(fn, max_retries = 3, quiet = FALSE, desc = "Download")
Arguments
fn |
Function to execute (should return data on success) |
max_retries |
Maximum number of retry attempts |
quiet |
If TRUE, suppresses retry warnings |
desc |
Description of what's being downloaded (for error messages) |
Value
Result from fn() if successful
Download and Extract File from ZIP Archive
Description
Downloads a ZIP archive, extracts a file matching file_pattern,
validates its size, and returns the path to the extracted file.
Usage
download_zip(
url,
file_pattern = "\\.csv$",
min_size = 1000,
ssl_verify = TRUE,
max_retries = 3,
quiet = FALSE
)
Arguments
url |
Character. URL of the ZIP archive. |
file_pattern |
Character. Regex pattern to match the target file
inside the archive. Default |
min_size |
Integer. Minimum extracted file size in bytes. Default 1000. |
ssl_verify |
Logical. Whether to verify SSL certificates. |
max_retries |
Integer. Number of retry attempts. |
quiet |
Logical. Suppress progress messages. |
Value
Character. Path to the extracted file.
Character Encoding Utilities
Description
Internal utilities for consistent handling of Portuguese characters. The package uses UTF-8 encoding (declared in DESCRIPTION) throughout.
Fallback to GitHub Release on Download Failure
Description
Attempts to load a dataset from the package's GitHub release when a primary web download has failed. Returns NULL on miss so callers can decide whether to abort or degrade gracefully.
Usage
fallback_to_github_cache(dataset_name, quiet = FALSE)
Arguments
dataset_name |
Character. Asset stem used in the GitHub release (e.g.,
|
quiet |
Logical. If TRUE, suppresses messages. |
Value
A tibble if the GitHub release asset is available, otherwise NULL.
Fetch a Cache Asset from GitHub Releases
Description
Downloads a single asset from the package's cache-latest release into a
tempfile, reads it, and returns the deserialised object. Tries .rds
first, then .csv.gz. Returns NULL on miss (either format missing, the
release does not exist, or network failure).
Usage
fetch_github_release_asset(cached_name, quiet = FALSE)
Arguments
cached_name |
Character. Asset stem, e.g. |
quiet |
Logical. Suppress informational messages. |
Value
The deserialised dataset, or NULL.
Get Credit Indicators from Abecip
Description
Get Credit Indicators from Abecip
Usage
get_abecip_indicators(table = "sbpe", quiet = FALSE, max_retries = 3L)
Arguments
table |
Character. One of |
quiet |
Logical. If |
max_retries |
Integer. Maximum number of retry attempts for failed downloads. Defaults to 3. |
Details
Downloads housing credit data from Abecip including SBPE monetary flows, financed units, and home-equity loan data.
Value
Either a named list (when table is 'all') or a tibble
(for specific tables). The return includes metadata attributes:
- download_info
List with download statistics
- source
Data source used
- download_time
Timestamp of download
Source
Brazilian Association of Real Estate Credit and Savings (ABECIP)
Import Indicators from the Abrainc-Fipe Report
Description
Import Indicators from the Abrainc-Fipe Report
Usage
get_abrainc_indicators(table = "indicator", quiet = FALSE, max_retries = 3L)
Arguments
table |
Character. One of |
quiet |
Logical. If |
max_retries |
Integer. Maximum number of retry attempts for failed downloads. Defaults to 3. |
Details
Downloads data from the Abrainc-Fipe Indicators report including information on new launches, sales, delivered units, and market indicators.
Value
Either a named list (when table is 'all') or a tibble
(for specific tables). The return includes metadata attributes:
- download_info
List with download statistics
- source
Data source used
- download_time
Timestamp of download
Source
Abrainc-Fipe Indicators (FIPE)
Get Available Tables from Dataset Info
Description
Get Available Tables from Dataset Info
Usage
get_available_tables(dataset_info)
Import Real Estate data from the Brazilian Central Bank
Description
Imports real estate data from BCB including credit sources, applications, financed units, and real estate indices.
Usage
get_bcb_realestate(table = "all", quiet = FALSE, max_retries = 3L)
Arguments
table |
Character. One of |
quiet |
Logical. If |
max_retries |
Integer. Maximum retry attempts. Defaults to 3. |
Value
Tibble with BCB real estate data. Includes metadata attributes: source, download_time.
Source
Brazilian Central Bank (BCB) Open Data Portal
Download macroeconomic time-series from BCB
Description
Download macroeconomic time-series from BCB
Usage
get_bcb_series(
table = "core",
date_start = as.Date("2010-01-01"),
quiet = FALSE,
max_retries = 3L,
...
)
Arguments
table |
Character. Hierarchy level to return:
|
date_start |
A |
quiet |
Logical. If |
max_retries |
Integer. Maximum retry attempts for failed API calls. Defaults to 3. |
... |
Additional arguments passed to |
Details
Downloads macroeconomic time series from BCB. Series are organized by relevance to the Brazilian real estate market using a four-level hierarchy. The default ("core") returns the 40 most directly relevant series covering real estate credit concession, interest rates, and delinquency. Use broader levels to include macroeconomic context series.
Value
A 4-column tibble with columns date, code_bcb,
name_simplified, and value. Series metadata is available in
bcb_metadata.
Source
Brazilian Central Bank (BCB) Time Series Management System (SGS)
Get Cached Asset Stem for Dataset
Description
Maps a dataset name (and optional table) to the asset stem used in GitHub releases — i.e. the file name without extension.
Usage
get_cached_name(name, dataset_info, table = NULL)
Get Dataset
Description
Unified interface for accessing all realestatebr datasets. Resolves data from the package's GitHub release assets when possible (fast, pre-processed, updated weekly by CI) and falls back to a fresh download from the original source. Repeated calls within one R session are served from an in-memory memo to avoid redundant network traffic.
Usage
get_dataset(
name,
table = NULL,
source = "auto",
date_start = NULL,
date_end = NULL,
...
)
Arguments
name |
Character. Dataset name (see |
table |
Character. Specific table within a multi-table dataset. See
|
source |
Character. Data source preference:
Use |
date_start |
Date. Start date for time series filtering (where applicable). |
date_end |
Date. End date for time series filtering (where applicable). |
... |
Additional arguments passed to internal dataset functions. |
Value
A tibble or named list, depending on the dataset. Use
get_dataset_info to inspect the expected structure.
See Also
list_datasets for available datasets,
get_dataset_info for dataset details,
clear_session_cache to drop the in-session memo.
Examples
abecip_data <- get_dataset("abecip")
sbpe_data <- get_dataset("abecip", table = "sbpe")
bcb_recent <- get_dataset("bcb_series", date_start = as.Date("2020-01-01"))
Get Dataset from Specific Source
Description
Get Dataset from Specific Source
Usage
get_dataset_from_source(
name,
dataset_info,
source,
table,
date_start,
date_end,
...
)
Get Dataset Information
Description
Returns detailed metadata for a single dataset, including available tables and source information.
Usage
get_dataset_info(name)
Arguments
name |
Character. Dataset identifier (see |
Value
A named list with the following elements:
- metadata
Title, description, geography, frequency, and coverage.
- categories
Available tables/subtables and their descriptions.
- source_info
Source organization and URL.
- technical_info
Cached file names and translation notes.
Examples
info <- get_dataset_info("abecip")
str(info)
Get Dataset with Fallback Strategy
Description
Auto strategy: in-session memo -> GitHub release -> fresh download.
Usage
get_dataset_with_fallback(name, dataset_info, table, date_start, date_end, ...)
Get FGV IBRE Confidence Indicators
Description
Loads construction confidence indicators from FGV IBRE including confidence indices, expectation indicators, and INCC price indices. FGV data is not available via API; this function fetches the pre-processed dataset from the package's GitHub release.
Usage
get_fgv_ibre(table = "indicators", quiet = FALSE)
Arguments
table |
Character. Which dataset to return: "indicators" (default) or "all". |
quiet |
Logical. If |
Value
Tibble with FGV IBRE indicators. Includes metadata attributes: source, download_time.
Get Data from GitHub Release Cache
Description
Downloads the appropriate asset into a tempfile and returns the deserialised object, applying table filtering where applicable.
Usage
get_from_github_cache(name, dataset_info, table)
Get Data from Internal Function
Description
Calls dataset-specific internal functions for a fresh download from the original source.
Usage
get_from_internal_function(
name,
dataset_info,
table,
date_start,
date_end,
...
)
Get Stacked RPPI Data
Description
Get Stacked RPPI Data
Usage
get_rppi(table = "sale", quiet = FALSE, max_retries = 3L)
Arguments
table |
Character. "sale", "rent", or "all" |
quiet |
Logical. If TRUE, suppresses messages |
max_retries |
Integer. Maximum retry attempts |
Details
Stacks multiple Brazilian residential property price indices into a single tibble with consistent columns for easy comparison. Handles different RPPI sources (IGMI-R, IVG-R, FipeZap, IVAR, IQAIW) and standardizes their formats.
Sale stack: IGMI-R, IVG-R, FipeZap. Rent stack: IVAR, IQAIW, FipeZap. Use get_dataset("rppi", table) for individual indices (IQA, IQAIW, Secovi-SP, etc.).
Value
Tibble with columns: date, name_muni, index, chg, acum12m, source (plus transaction_type if table="all")
Get Residential Property Price Indices from BIS
Description
Downloads Residential Property Price Indices from BIS with support for selected series and detailed monthly/quarterly/annual/halfyearly datasets.
Usage
get_rppi_bis(table = "selected", quiet = FALSE, max_retries = 3L)
Arguments
table |
Character. Dataset table: "selected", "detailed_monthly", "detailed_quarterly", "detailed_annual", or "detailed_halfyearly". |
quiet |
Logical. If |
max_retries |
Integer. Maximum retry attempts. Defaults to 3. |
Value
Tibble with BIS RPPI data. Includes metadata attributes: source, download_time.
Source
Bank for International Settlements (BIS) Residential Property Prices
Get FipeZap RPPI
Description
Get FipeZap RPPI
Usage
get_rppi_fipezap(city = "all", quiet = FALSE, max_retries = 3L)
Arguments
city |
City name or "all" (default). Filtering by city doesn't save processing time. |
quiet |
Logical. If TRUE, suppresses warnings |
max_retries |
Integer. Maximum retry attempts |
Details
The FipeZap Index is a monthly median stratified index across ~20 Brazilian cities,
based on online listings from Zap Imoveis. Includes residential and commercial markets,
both sale and rent, stratified by number of rooms. The overall city index is a weighted
sum of median prices by room/region. Residential index includes only apartments, studios,
and flats. National index: name_muni == 'Brazil' (after standardization).
Value
Tibble with columns: date, name_muni, market, rent_sale, variable, rooms, value
Get the IGMI Sales Index
Description
Get the IGMI Sales Index
Usage
get_rppi_igmi(quiet = FALSE, max_retries = 3L)
Arguments
quiet |
Logical. If TRUE, suppresses warnings |
max_retries |
Integer. Maximum retry attempts for downloads |
Details
The IGMI-R (Residential Real Estate Index) is a hedonic sales index based on bank appraisal reports, available for Brazil + 10 capital cities. Hedonic indices account for both composition bias and quality differentials across the housing stock. Maintained by ABECIP in partnership with FGV.
Value
Tibble with columns: date, name_muni, index, chg, acum12m
Get QuintoAndar Rental Index (IQA)
Description
Get QuintoAndar Rental Index (IQA)
Usage
get_rppi_iqa(quiet = FALSE, max_retries = 3L)
Arguments
quiet |
Logical. If TRUE, suppresses warnings |
max_retries |
Integer. Maximum retry attempts for downloads |
Details
The IQA (QuintoAndar Rental Index) is a median stratified index for Rio de Janeiro
and Sao Paulo, based on new rent contracts managed by QuintoAndar. Includes only
apartments, studios, and flats. Note: IQA provides raw prices (not index numbers),
so rent_price is the median rent per square meter.
Value
Tibble with columns: date, name_muni, rent_price, chg, acum12m
Get QuintoAndar ImovelWeb Rental Index (IQAIW)
Description
Get QuintoAndar ImovelWeb Rental Index (IQAIW)
Usage
get_rppi_iqaiw(quiet = FALSE, max_retries = 3L)
Arguments
quiet |
Logical. If TRUE, suppresses warnings |
max_retries |
Integer. Maximum retry attempts for downloads |
Details
The IQAIW (Indice QuintoAndar ImovelWeb) is a rental index for major Brazilian cities. The index is based on both new rental contracts (managed by QuintoAndar) and online listings from QuintoAndar's listings (including ImovelWeb). The IQAIW was developed in 2023 and replaced the former IQA index. Given the change in methodology and data sources, the IQAIW is not directly comparable to the IQA index. Formally, the index is a hedonic double imputed index, controlling for quality changes using a flexible GAM specification with location variables. In this sense, the IQAIW is more theoretically sound than median stratified indices like FipeZap or the former IQA. The mixture of listings and contracts, however, lacks theoretical support and seems to be mainly driven by branding purposes. The ImovelWeb brand was purchased by QuintoAndar in 2021-22 and the IQAIW symbolizes the merging of both brands. In other words, the original IQA could've been improved simply by adopting a hedonic methodology, without the need to mix data sources.
Value
Tibble with columns: date, name_muni, index, chg, acum12m, price_m2
Get IVAR Rent Index
Description
Get IVAR Rent Index
Usage
get_rppi_ivar(quiet = FALSE, max_retries = 3L)
Arguments
quiet |
Logical. If TRUE, suppresses warnings |
max_retries |
Integer. Maximum retry attempts (not used for this data source) |
Details
The IVAR (Residential Rent Variation Index) is a repeat-rent index from IBRE/FGV, comparing the same housing unit over time. Based on rental contracts from brokers. Available for 4 major cities (Sao Paulo, Rio, Porto Alegre, Belo Horizonte); the national index is a weighted average. More theoretically sound than IGP-M for rent contracts as it measures only rent prices.
Value
Tibble with columns: date, name_muni, index, chg, acum12m, name_simplified, abbrev_state
Note
IVAR's underlying source (FGV) is not accessible via web scraping;
when the static fgv_data object is unavailable, this function falls back
to the package's GitHub release.
Get the IVGR Sales Index
Description
Get the IVGR Sales Index
Usage
get_rppi_ivgr(quiet = FALSE, max_retries = 3L)
Arguments
quiet |
Logical. If TRUE, suppresses warnings |
max_retries |
Integer. Maximum retry attempts for downloads |
Details
The IVG-R (Residential Real Estate Collateral Value Index) is a monthly median sales index based on bank appraisals, calculated by the Brazilian Central Bank (BCB series 21340). The index estimates long-run trends in home prices using the Hodrick-Prescott filter (lambda=3600) applied to major metropolitan regions. Note: Median indices suffer from composition bias and cannot account for quality changes across the housing stock.
Value
Tibble with columns: date, name_geo, index, chg, acum12m
References
Banco Central do Brasil (2018) "Indice de Valores de Garantia de Imoveis Residenciais Financiados (IVG-R). Seminario de Metodologia do IBGE."
Get Secovi-SP Rent Index
Description
Get Secovi-SP Rent Index
Usage
get_rppi_secovi_sp(quiet = FALSE, max_retries = 3L)
Arguments
quiet |
Logical. If TRUE, suppresses warnings |
max_retries |
Integer. Maximum retry attempts |
Details
Secovi-SP rent price index for Sao Paulo. Wrapper around get_secovi() that extracts and formats rent price data as RPPI.
Value
Tibble with columns: date, name_muni, index, chg, acum12m
Import data from Secovi-SP
Description
Import data from Secovi-SP
Usage
get_secovi(table = "all", quiet = FALSE, max_retries = 3L)
Arguments
table |
Character. One of |
quiet |
Logical. If |
max_retries |
Integer. Maximum number of retry attempts for failed web scraping operations. Defaults to 3. |
Details
Scrapes real estate data from SECOVI-SP including condominium fees, rental market data, launches, and sales information.
Value
A tibble with SECOVI-SP real estate data. The return includes
metadata attributes:
- download_info
List with download statistics
- source
Data source used
- download_time
Timestamp of download
Harmonize FipeZap Data for Stacking
Description
Harmonize FipeZap Data for Stacking
Usage
harmonize_fipezap_for_stacking(dat, transaction_type = NULL)
Arguments
dat |
FipeZap data tibble |
transaction_type |
"sale" or "rent" to filter for stacking |
Value
Harmonized tibble with standard RPPI columns
Check if Debug Mode is Enabled
Description
Checks whether debug mode is enabled for detailed package messaging. Debug mode can be enabled via environment variable or package option.
Usage
is_debug_mode()
Details
Debug mode can be enabled in two ways (checked in order of precedence):
Environment variable:
REALESTATEBR_DEBUG=TRUEPackage option:
options(realestatebr.debug = TRUE)
When debug mode is enabled, all detailed processing messages are shown, including file-by-file progress, type detection, and intermediate steps. This is useful for development and troubleshooting.
Value
Logical. TRUE if debug mode is enabled, FALSE otherwise.
List Available Datasets
Description
Returns a tibble describing all datasets available in the realestatebr package. Optionally filter by category, source organization, or geographic coverage.
Usage
list_datasets(category = NULL, source = NULL, geography = NULL)
Arguments
category |
Optional character. Keyword matched against the dataset description
(e.g., |
source |
Optional character. Filter by data source organization
(e.g., |
geography |
Optional character. Filter by geographic coverage
(e.g., |
Value
A tibble with one row per dataset and the following columns:
- name
Dataset identifier used with
get_dataset.- title
English dataset name.
- title_pt
Portuguese dataset name.
- description
Brief description.
- source
Data source organization.
- geography
Geographic coverage.
- frequency
Update frequency.
- coverage
Time period covered.
- available_tables
Comma-separated table names for multi-table datasets.
See Also
get_dataset for retrieving data,
get_dataset_info for detailed metadata on a single dataset.
Examples
list_datasets()
list_datasets(source = "BCB")
Load and Process CGI Data from Bundled Excel File
Description
Load and Process CGI Data from Bundled Excel File
Usage
load_abecip_cgi(path)
Arguments
path |
Path to abecip_cgi.xlsx |
Value
A tibble with processed CGI data
Load Dataset Registry from YAML
Description
Internal function to load the dataset registry from the inst/extdata/datasets.yaml file.
Usage
load_dataset_registry()
Value
A list containing the parsed YAML registry
Build Memo Key for Dataset + Table
Description
Build Memo Key for Dataset + Table
Usage
memo_key(name, table)
Convert Registry to Tibble
Description
Internal function to convert the nested YAML registry structure to a flat tibble suitable for display and filtering.
Usage
registry_to_tibble(registry)
Arguments
registry |
List containing the parsed YAML registry |
Value
A tibble with dataset information
Resolve BCB Hierarchy Level to Series Codes
Description
Maps a hierarchy level name to a vector of BCB series codes. The levels are cumulative: "primary" includes all "core" series, "secondary" includes all "primary" series, and so on.
Usage
resolve_bcb_hierarchy(table)
Arguments
table |
Character. One of "core", "primary", "secondary", "tertiary", "full", or "all". |
Value
Integer vector of BCB series codes.
RPPI Helper Functions
Description
Internal helper functions to reduce code duplication in RPPI functions. These are not exported and only used internally.
Show Dataset Import Message
Description
Show Dataset Import Message
Usage
show_import_message(name, table_info)
Standardize RPPI Structure
Description
Standardize RPPI Structure
Usage
standardize_rppi_structure(dat)
Arguments
dat |
Input tibble from any RPPI source |
Value
Standardized tibble with consistent columns
Check if Internal Function Supports table="all"
Description
Check if Internal Function Supports table="all"
Usage
supports_table_all(func_name)
Test function to verify encoding patterns work correctly
Description
Test function to verify encoding patterns work correctly
Usage
test_encoding_patterns()
Validate Abecip Data
Description
Validate Abecip Data
Usage
validate_abecip_data(data, type)
Arguments
data |
Data frame to validate |
type |
Type of data ("sbpe" or "units") |
Value
NULL (validates or errors)
Validate and Resolve Table Parameter
Description
Validate and Resolve Table Parameter
Usage
validate_and_resolve_table(name, dataset_info, table = NULL)
Generic Data Validation
Description
Validates basic dataset requirements. Consolidates validation logic used across all dataset functions.
Usage
validate_dataset(
data,
dataset_name,
required_cols = "date",
min_rows = 1,
check_dates = TRUE,
max_future_days = 90
)
Arguments
data |
Data frame or tibble. The dataset to validate. |
dataset_name |
Character. Name of dataset for error messages. |
required_cols |
Character vector. Required column names. Default is "date". |
min_rows |
Integer. Minimum expected number of rows. Default 1. |
check_dates |
Logical. Whether to validate date column. Default TRUE. |
max_future_days |
Integer. Maximum days in future allowed for dates. Default 90. |
Value
Invisible TRUE if all validations pass. Errors or warns otherwise.
Generic Parameter Validation for Dataset Functions
Description
Validates common parameters used across all dataset functions.
Usage
validate_dataset_params(
table,
valid_tables,
quiet,
max_retries,
allow_all = TRUE
)
Arguments
table |
Character. The table parameter to validate. |
valid_tables |
Character vector. Valid table names for the dataset. |
quiet |
Logical. Whether to suppress messages. |
max_retries |
Numeric. Maximum number of retry attempts. |
allow_all |
Logical. Whether "all" is a valid table value. Default TRUE. |
Value
Invisible TRUE if all validations pass. Errors otherwise.