Type: | Package |
Title: | Deflate Nominal Brazilian Reais |
Version: | 1.1.2 |
Description: | Simple functions to deflate nominal Brazilian Reais using several popular price indexes downloaded from the Brazilian Institute for Applied Economic Research. |
License: | MIT + file LICENSE |
Depends: | R (≥ 3.1.2) |
Imports: | dplyr (≥ 0.5.0), lubridate, httr |
Encoding: | UTF-8 |
LazyData: | true |
URL: | https://github.com/meirelesff/deflatebr/ |
BugReports: | https://github.com/meirelesff/deflatebr/issues/ |
RoxygenNote: | 6.1.0 |
Suggests: | knitr, rmarkdown |
NeedsCompilation: | no |
Packaged: | 2018-09-17 14:13:32 UTC; meire |
Author: | Fernando Meireles [aut, cre] |
Maintainer: | Fernando Meireles <fmeireles@ufmg.br> |
Repository: | CRAN |
Date/Publication: | 2018-09-28 21:30:12 UTC |
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 |
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: |
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 |
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). |
Value
A numeric
vector.
See Also
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 |
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). |
Value
A numeric
vector.
See Also
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 ( |
end_date |
End date in the 'MM/YYYY' format ( |
index |
One of the following options: |
Value
The inflation rate, in percent, between initial_date
and end_date
.
See Also
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 |
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). |
Value
A numeric
vector.
See Also
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 |
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). |
Value
A numeric
vector.
See Also
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 |
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). |
Value
A numeric
vector.
See Also
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)