Title: | Deflate Nominal Brazilian Reais |
---|---|
Description: | Simple functions to deflate nominal Brazilian Reais using several popular price indexes downloaded from the Brazilian Institute for Applied Economic Research. |
Authors: | Fernando Meireles [aut, cre] |
Maintainer: | Fernando Meireles <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.1.2 |
Built: | 2025-03-03 03:02:15 UTC |
Source: | https://github.com/meirelesff/deflatebr |
deflate()
uses data from the Brazilian Institute for Applied Economic Research's API (IPEADATA) to adjust nominal Brazilian Reais for inflation.
deflate(nominal_values, nominal_dates, real_date, index = c("ipca", "igpm", "igpdi", "ipc", "inpc"))
deflate(nominal_values, nominal_dates, real_date, index = c("ipca", "igpm", "igpdi", "ipc", "inpc"))
nominal_values |
A |
nominal_dates |
A |
real_date |
A value indicating the reference date to deflate nominal values in the format 'MM/YYYY' (e.g., '01/2018' for January 2018). |
index |
Indicates the price index used to deflate nominal Reais. Valid options are: |
Each one of the five price indexes included in the function are maintained by two Brazilian agencies: IPCA and INPC indexes are maintained by Brazilian Institute of Geography and Statistics (IBGE); IGP-M, IGP-DI, and IPC are maintained by Getulio Vargas Foundation (FGV). For an overview of the indexes' methodologies and covered periods, check the Brazilian Central Bank official FAQ.
A numeric
vector.
For more information on the Brazilian Institute for Applied Economic Research's API, please check (in Portuguese): http://www.ipeadata.gov.br/.
## Not run: # Use IPCA index to deflate a vector of nominal Brazilian Reais reais <- rep(100, 5) actual_dates <- seq.Date(from = as.Date("2001-01-01"), to = as.Date("2001-05-01"), by = "month") deflate(reais, actual_dates, "01/2018", "ipca") # Using IGP-M index deflate(reais, actual_dates, "01/2018", "igpm") ## End(Not run)
## Not run: # Use IPCA index to deflate a vector of nominal Brazilian Reais reais <- rep(100, 5) actual_dates <- seq.Date(from = as.Date("2001-01-01"), to = as.Date("2001-05-01"), by = "month") deflate(reais, actual_dates, "01/2018", "ipca") # Using IGP-M index deflate(reais, actual_dates, "01/2018", "igpm") ## End(Not run)
ipc()
is a convenience function to deflate nominal Brazilian Reais using the Getulio Vargas Foundation's IGP-DI price index.
igpdi(nominal_values, nominal_dates, real_date)
igpdi(nominal_values, nominal_dates, real_date)
nominal_values |
A |
nominal_dates |
A |
real_date |
A value indicating the reference date to deflate nominal values in the format 'MM/YYYY' (e.g., '01/2018' for January 2018). |
A numeric
vector.
## Not run: # Use IGP-DI index to deflate a vector of nominal Brazilian Reais reais <- rep(100, 5) actual_dates <- seq.Date(from = as.Date("2001-01-01"), to = as.Date("2001-05-01"), by = "month") igpdi(reais, actual_dates, "01/2018") ## End(Not run)
## Not run: # Use IGP-DI index to deflate a vector of nominal Brazilian Reais reais <- rep(100, 5) actual_dates <- seq.Date(from = as.Date("2001-01-01"), to = as.Date("2001-05-01"), by = "month") igpdi(reais, actual_dates, "01/2018") ## End(Not run)
ipgm()
is a convenience function to deflate nominal Brazilian Reais using the Getulio Vargas Foundation's IGP-M price index.
igpm(nominal_values, nominal_dates, real_date)
igpm(nominal_values, nominal_dates, real_date)
nominal_values |
A |
nominal_dates |
A |
real_date |
A value indicating the reference date to deflate nominal values in the format 'MM/YYYY' (e.g., '01/2018' for January 2018). |
A numeric
vector.
## Not run: # Use IGP-M index to deflate a vector of nominal Brazilian Reais reais <- rep(100, 5) actual_dates <- seq.Date(from = as.Date("2001-01-01"), to = as.Date("2001-05-01"), by = "month") igpm(reais, actual_dates, "01/2018") ## End(Not run)
## Not run: # Use IGP-M index to deflate a vector of nominal Brazilian Reais reais <- rep(100, 5) actual_dates <- seq.Date(from = as.Date("2001-01-01"), to = as.Date("2001-05-01"), by = "month") igpm(reais, actual_dates, "01/2018") ## End(Not run)
inflation()
is a convenience function used to calculate the inflation rate between two periods
inflation(initial_date, end_date, index = c("ipca", "inpc", "igpm", "igpdi", "ipc"))
inflation(initial_date, end_date, index = c("ipca", "inpc", "igpm", "igpdi", "ipc"))
initial_date |
Initial date in the 'MM/YYYY' format ( |
end_date |
End date in the 'MM/YYYY' format ( |
index |
One of the following options: |
The inflation rate, in percent, between initial_date
and end_date
.
## Not run: # Inflation rate between January 2010 to January 2018 calculated using IPCA price index inflation("01/2010", "01/2018", "ipca") # Inflation rate between January 2014 to December 2014 calculated using IGP-M price index inflation("01/2014", "12/2014", "igpm") ## End(Not run)
## Not run: # Inflation rate between January 2010 to January 2018 calculated using IPCA price index inflation("01/2010", "01/2018", "ipca") # Inflation rate between January 2014 to December 2014 calculated using IGP-M price index inflation("01/2014", "12/2014", "igpm") ## End(Not run)
inpc()
is a convenience function to deflate nominal Brazilian Reais using the Brazilian Institute of Geography and Statistics' INPC price index.
inpc(nominal_values, nominal_dates, real_date)
inpc(nominal_values, nominal_dates, real_date)
nominal_values |
A |
nominal_dates |
A |
real_date |
A value indicating the reference date to deflate nominal values in the format 'MM/YYYY' (e.g., '01/2018' for January 2018). |
A numeric
vector.
## Not run: # Use INPC index to deflate a vector of nominal Brazilian Reais reais <- rep(100, 5) actual_dates <- seq.Date(from = as.Date("2001-01-01"), to = as.Date("2001-05-01"), by = "month") inpc(reais, actual_dates, "01/2018") ## End(Not run)
## Not run: # Use INPC index to deflate a vector of nominal Brazilian Reais reais <- rep(100, 5) actual_dates <- seq.Date(from = as.Date("2001-01-01"), to = as.Date("2001-05-01"), by = "month") inpc(reais, actual_dates, "01/2018") ## End(Not run)
ipc()
is a convenience function to deflate nominal Brazilian Reais using the Getulio Vargas Foundation's IPC price index.
ipc(nominal_values, nominal_dates, real_date)
ipc(nominal_values, nominal_dates, real_date)
nominal_values |
A |
nominal_dates |
A |
real_date |
A value indicating the reference date to deflate nominal values in the format 'MM/YYYY' (e.g., '01/2018' for January 2018). |
A numeric
vector.
## Not run: # Use IPC index to deflate a vector of nominal Brazilian Reais reais <- rep(100, 5) actual_dates <- seq.Date(from = as.Date("2001-01-01"), to = as.Date("2001-05-01"), by = "month") ipc(reais, actual_dates, "01/2018") ## End(Not run)
## Not run: # Use IPC index to deflate a vector of nominal Brazilian Reais reais <- rep(100, 5) actual_dates <- seq.Date(from = as.Date("2001-01-01"), to = as.Date("2001-05-01"), by = "month") ipc(reais, actual_dates, "01/2018") ## End(Not run)
ipca()
is a convenience function to deflate nominal Brazilian Reais using the Brazilian Institute of Geography and Statistics' IPCA price index.
ipca(nominal_values, nominal_dates, real_date)
ipca(nominal_values, nominal_dates, real_date)
nominal_values |
A |
nominal_dates |
A |
real_date |
A value indicating the reference date to deflate nominal values in the format 'MM/YYYY' (e.g., '01/2018' for January 2018). |
A numeric
vector.
## Not run: # Use IPCA index to deflate a vector of nominal Brazilian Reais reais <- rep(100, 5) actual_dates <- seq.Date(from = as.Date("2001-01-01"), to = as.Date("2001-05-01"), by = "month") ipca(reais, actual_dates, "01/2018") ## End(Not run)
## Not run: # Use IPCA index to deflate a vector of nominal Brazilian Reais reais <- rep(100, 5) actual_dates <- seq.Date(from = as.Date("2001-01-01"), to = as.Date("2001-05-01"), by = "month") ipca(reais, actual_dates, "01/2018") ## End(Not run)