Package 'deflateBR'

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

Help Index


Deflate Nominal Brazilian Reais Using Various Price Indexes

Description

deflate() uses data from the Brazilian Institute for Applied Economic Research's API (IPEADATA) to adjust nominal Brazilian Reais for inflation.

Usage

deflate(nominal_values, nominal_dates, real_date, index = c("ipca",
  "igpm", "igpdi", "ipc", "inpc"))

Arguments

nominal_values

A numeric vector containing nominal Brazilian Reais to deflate.

nominal_dates

A Date vector with corresponding nominal dates (i.e., when nominal values were measured). Values are set to the previous month, following the standard methodology used by the Brazilian Central Bank.

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: ipca, igpm, igpdi, ipc, and inpc.

Details

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.

Value

A numeric vector.

References

For more information on the Brazilian Institute for Applied Economic Research's API, please check (in Portuguese): http://www.ipeadata.gov.br/.

Examples

## 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)

Deflate Nominal Brazilian Reais Using IGP-DI

Description

ipc() is a convenience function to deflate nominal Brazilian Reais using the Getulio Vargas Foundation's IGP-DI price index.

Usage

igpdi(nominal_values, nominal_dates, real_date)

Arguments

nominal_values

A numeric vector containing nominal Brazilian Reais to deflate.

nominal_dates

A Date vector with corresponding nominal dates (i.e., when nominal values were measured). Values are set to the previous month, following the standard methodology used by the Brazilian Central Bank.

real_date

A value indicating the reference date to deflate nominal values in the format 'MM/YYYY' (e.g., '01/2018' for January 2018).

Value

A numeric vector.

See Also

deflate.

Examples

## 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)

Deflate Nominal Brazilian Reais Using IGP-M

Description

ipgm() is a convenience function to deflate nominal Brazilian Reais using the Getulio Vargas Foundation's IGP-M price index.

Usage

igpm(nominal_values, nominal_dates, real_date)

Arguments

nominal_values

A numeric vector containing nominal Brazilian Reais to deflate.

nominal_dates

A Date vector with corresponding nominal dates (i.e., when nominal values were measured). Values are set to the previous month, following the standard methodology used by the Brazilian Central Bank.

real_date

A value indicating the reference date to deflate nominal values in the format 'MM/YYYY' (e.g., '01/2018' for January 2018).

Value

A numeric vector.

See Also

deflate.

Examples

## 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)

Calculate Inflation Between Two Dates

Description

inflation() is a convenience function used to calculate the inflation rate between two periods

Usage

inflation(initial_date, end_date, index = c("ipca", "inpc", "igpm",
  "igpdi", "ipc"))

Arguments

initial_date

Initial date in the 'MM/YYYY' format (character).

end_date

End date in the 'MM/YYYY' format (character).

index

One of the following options: ipca, inpc, igpm, igpdi, and ipc. Each one of these options uses the following price indexes, respectively: IPCA and INPC indexes maintained by Brazilian Institute of Geography and Statistics (IBGE); and IGP-M, IGP-DI, and IPC maintained by Getulio Vargas Foundation (FGV). For an overview of the indexes' methodologies and covered periods, check the Brazilian Central Bank official FAQ.

Value

The inflation rate, in percent, between initial_date and end_date.

See Also

deflate.

Examples

## 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)

Deflate Nominal Brazilian Reais Using INPC

Description

inpc() is a convenience function to deflate nominal Brazilian Reais using the Brazilian Institute of Geography and Statistics' INPC price index.

Usage

inpc(nominal_values, nominal_dates, real_date)

Arguments

nominal_values

A numeric vector containing nominal Brazilian Reais to deflate.

nominal_dates

A Date vector with corresponding nominal dates (i.e., when nominal values were measured). Values are set to the previous month, following the standard methodology used by the Brazilian Central Bank.

real_date

A value indicating the reference date to deflate nominal values in the format 'MM/YYYY' (e.g., '01/2018' for January 2018).

Value

A numeric vector.

See Also

deflate.

Examples

## 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)

Deflate Nominal Brazilian Reais Using IPC

Description

ipc() is a convenience function to deflate nominal Brazilian Reais using the Getulio Vargas Foundation's IPC price index.

Usage

ipc(nominal_values, nominal_dates, real_date)

Arguments

nominal_values

A numeric vector containing nominal Brazilian Reais to deflate.

nominal_dates

A Date vector with corresponding nominal dates (i.e., when nominal values were measured). Values are set to the previous month, following the standard methodology used by the Brazilian Central Bank.

real_date

A value indicating the reference date to deflate nominal values in the format 'MM/YYYY' (e.g., '01/2018' for January 2018).

Value

A numeric vector.

See Also

deflate.

Examples

## 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)

Deflate Nominal Brazilian Reais Using IPCA

Description

ipca() is a convenience function to deflate nominal Brazilian Reais using the Brazilian Institute of Geography and Statistics' IPCA price index.

Usage

ipca(nominal_values, nominal_dates, real_date)

Arguments

nominal_values

A numeric vector containing nominal Brazilian Reais to deflate.

nominal_dates

A Date vector with corresponding nominal dates (i.e., when nominal values were measured). Values are set to the previous month, following the standard methodology used by the Brazilian Central Bank.

real_date

A value indicating the reference date to deflate nominal values in the format 'MM/YYYY' (e.g., '01/2018' for January 2018).

Value

A numeric vector.

See Also

deflate.

Examples

## 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)