Title: | R Interface to Brazilian Central Bank Web Services |
---|---|
Description: | The Brazilian Central Bank API delivers many datasets which regard economic activity, regional economy, international economy, public finances, credit indicators and many more. For more information please see <http://dadosabertos.bcb.gov.br/>. These datasets can be accessed through 'rbcb' functions and can be obtained in different data structures common to R ('tibble', 'data.frame', 'xts', ...). |
Authors: | Wilson Freitas <[email protected]> |
Maintainer: | Wilson Freitas <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.14 |
Built: | 2025-01-19 05:31:31 UTC |
Source: | https://github.com/wilsonfreitas/rbcb |
Gets all currency values
get_all_currencies(date)
get_all_currencies(date)
date |
reference date |
A data.frame
with all currency values from the given date.
The currency rates come quoted in BRL.
## Not run: get_all_currencies("2017-03-10") ## End(Not run)
## Not run: get_all_currencies("2017-03-10") ## End(Not run)
Statistics for the annual expectations of economic indicators. All statistics are computed based on annual expectations provided by many financial institutions in Brazil: banks, funds, risk managers, so on and so forth. These expections and its statistics are used to build the FOCUS Report weekly released by the Brazilian Central Bank.
get_annual_market_expectations( indic = NULL, start_date = NULL, end_date = NULL, ... )
get_annual_market_expectations( indic = NULL, start_date = NULL, end_date = NULL, ... )
indic |
a character vector with economic indicators names. They are case sensitive and don't forget the accents. |
start_date |
series initial date. Accepts ISO character formated date and |
end_date |
series final date. Accepts ISO character formated date and |
... |
additional parameters to be passed to the API
The |
There are annual expectations available for the following indicators:
Balança Comercial
Câmbio
Conta corrente
Dívida bruta do governo geral
Dívida líquida do setor público
IGP-DI
IGP-M
INPC
Investimento direto no país
IPA-DI
IPA-M
IPCA
IPCA Administrados
IPCA Alimentação no domicílio
IPCA Bens industrializados
IPCA Livres
IPCA Serviços
IPCA-15
IPC-FIPE
PIB Agropecuária
PIB Despesa de consumo da administração pública
PIB despesa de consumo das famílias
PIB Exportação de bens e serviços
PIB Formação Bruta de Capital Fixo
PIB Importação de bens e serviços
PIB Indústria
PIB Serviços
PIB Total
Produção industrial
Resultado nominal
Resultado primário
Selic
Taxa de desocupação
Check <https://olinda.bcb.gov.br/olinda/servico/Expectativas/versao/v1/documentacao#ExpectativasMercadoAnuais> for more details
A data.frame
with the requested data.
## Not run: indic <- c("PIB Total", "Fiscal") end_date <- "2018-01-31" x <- get_annual_market_expectations(indic, end_date = end_date, `$top` = 10) # return all indicators for the specified date range start_date <- "2021-01-01" x <- get_annual_market_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
## Not run: indic <- c("PIB Total", "Fiscal") end_date <- "2018-01-31" x <- get_annual_market_expectations(indic, end_date = end_date, `$top` = 10) # return all indicators for the specified date range start_date <- "2021-01-01" x <- get_annual_market_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
Given a currency symbol and a time interval (in dates) this function returns the bid and ask time series of currency rates.
get_currency( symbol, start_date, end_date, as = c("tibble", "xts", "data.frame", "text") )
get_currency( symbol, start_date, end_date, as = c("tibble", "xts", "data.frame", "text") )
symbol |
currency symbol |
start_date |
time interval initial date |
end_date |
time interval last date |
as |
the object's returning type The The time series date range is defined by |
The time series with the bid and ask currency rates regarding the given symbol quoted in BRL.
The default returning is a tibble
-fashioned data.frame
with
the three columns: date
, ask
and bid
.
The as
argument also accepts data.frame
to return old fashioned data frames,
xts
to return a xts object with two variables (bid and ask) and text
which returns
the text content download from BCB site.
## Not run: get_currency("USD", "2017-03-01", "2017-03-10") ## End(Not run)
## Not run: get_currency("USD", "2017-03-01", "2017-03-10") ## End(Not run)
The currency matrix has the currency cross rates for all currencies present in the BCB system.
get_currency_cross_rates(date, ref = c("ask", "bid"))
get_currency_cross_rates(date, ref = c("ask", "bid"))
date |
reference date |
ref |
reffers to
|
A square matrix
with colnames
and rownames
filled with currency symbols
The cells must be read as ROW
in COL
, for example, BRL (row) in USD (column) means Brazilian Reals in American Dollars.
## Not run: x <- get_currency_cross_rates("2017-03-10") currencies <- c("USD", "BRL", "AUD", "EUR", "CAD") x[currencies, currencies] ## End(Not run)
## Not run: x <- get_currency_cross_rates("2017-03-10") currencies <- c("USD", "BRL", "AUD", "EUR", "CAD") x[currencies, currencies] ## End(Not run)
General function to get statistics of market expectations. The API provides requests for annual, monthly, and quarterly expectations. Is is also proveided expectations for 12 months ahead, specific requests for the top 5 indicators for annual and monthly expectations and data provided by financial institutions.
get_market_expectations( type = c("annual", "quarterly", "monthly", "inflation-12-months", "top5s-monthly", "top5s-annual", "selic", "top5s-selic"), indic = NULL, start_date = NULL, end_date = NULL, keep_names = TRUE, ... )
get_market_expectations( type = c("annual", "quarterly", "monthly", "inflation-12-months", "top5s-monthly", "top5s-annual", "selic", "top5s-selic"), indic = NULL, start_date = NULL, end_date = NULL, keep_names = TRUE, ... )
type |
a character with one of the following: |
indic |
a character vector with economic indicators names. They are case sensitive and don't forget the accents. |
start_date |
series initial date.
Accepts ISO character formated date and |
end_date |
series final date.
Accepts ISO character formated date and |
keep_names |
if |
... |
additional parameters to be passed to the API
The |
All statistics are computed based on expectations provided by many financial institutions in Brazil: banks, funds, risk managers, so on and so forth. These expections and its statistics are used to build the FOCUS Report weekly released by the Brazilian Central Bank.
There are market expectations available for the following indicators:
Balança Comercial
Câmbio
Conta corrente
Dívida bruta do governo geral
Dívida líquida do setor público
IGP-DI
IGP-M
INPC
Investimento direto no país
IPA-DI
IPA-M
IPCA
IPCA Administrados
IPCA Alimentação no domicílio
IPCA Bens industrializados
IPCA Livres
IPCA Serviços
IPCA-15
IPC-FIPE
PIB Agropecuária
PIB Despesa de consumo da administração pública
PIB despesa de consumo das famílias
PIB Exportação de bens e serviços
PIB Formação Bruta de Capital Fixo
PIB Importação de bens e serviços
PIB Indústria
PIB Serviços
PIB Total
Produção industrial
Resultado nominal
Resultado primário
Selic
Taxa de desocupação
Check <https://olinda.bcb.gov.br/olinda/servico/Expectativas/versao/v1/documentacao> for more details
A data.frame
with the requested data.
## Not run: indic <- c("IPCA", "Câmbio") x <- get_market_expectations("annual", indic, `$top` = 10) x <- get_market_expectations("monthly", "Selic", `$top` = 20) # get monthly expectations for top 5 indicators since 2021 x <- get_market_expectations("top5s-monthly", start_date = "2021-01-01") # get annual expectations for top 5 indicators since 2021 x <- get_market_expectations("top5s-annual", `$top` = 20) # get all inflation expectations for 12 months ahead starting on 2021-01 x <- get_market_expectations("inflation-12-months", start_date = "2021-01-01") # get all SELIC expectations informed by financial institutions since 2022 x <- get_market_expectations("selic", start_date = "2022-01-01") # get TOP5 SELIC expectations starting on 2022 x <- get_market_expectations("top5s-selic", start_date = "2022-01-01") ## End(Not run)
## Not run: indic <- c("IPCA", "Câmbio") x <- get_market_expectations("annual", indic, `$top` = 10) x <- get_market_expectations("monthly", "Selic", `$top` = 20) # get monthly expectations for top 5 indicators since 2021 x <- get_market_expectations("top5s-monthly", start_date = "2021-01-01") # get annual expectations for top 5 indicators since 2021 x <- get_market_expectations("top5s-annual", `$top` = 20) # get all inflation expectations for 12 months ahead starting on 2021-01 x <- get_market_expectations("inflation-12-months", start_date = "2021-01-01") # get all SELIC expectations informed by financial institutions since 2022 x <- get_market_expectations("selic", start_date = "2022-01-01") # get TOP5 SELIC expectations starting on 2022 x <- get_market_expectations("top5s-selic", start_date = "2022-01-01") ## End(Not run)
Statistics for the monthly expectations of economic indicators. All statistics are computed based on monthly expectations provided by many financial institutions in Brazil: banks, funds, risk managers, so on and so forth. These expections and its statistics are used to build the FOCUS Report weekly released by the Brazilian Central Bank.
get_monthly_market_expectations( indic = NULL, start_date = NULL, end_date = NULL, ... )
get_monthly_market_expectations( indic = NULL, start_date = NULL, end_date = NULL, ... )
indic |
a character vector with economic indicators names. They are case sensitive and don't forget the accents. |
start_date |
series initial date. Accepts ISO character formated date and |
end_date |
series final date. Accepts ISO character formated date and |
... |
additional parameters to be passed to the API
The |
There are monthly expectations available for the following indicators:
Câmbio
IGP-DI
IGP-M
INPC
IPA-DI
IPA-M
IPCA
IPCA Administrados
IPCA Alimentação no domicílio
IPCA Bens industrializados
IPCA Livres
IPCA Serviços
IPCA-15
IPC-Fipe
Produção industrial
Selic
Taxa de desocupação
Check <https://olinda.bcb.gov.br/olinda/servico/Expectativas/versao/v1/documentacao#ExpectativaMercadoMensais> for more details
A data.frame
with the requested data.
## Not run: indic <- c("IPCA", "IPC-Fipe") end_date <- "2018-01-31" x <- get_monthly_market_expectations(indic, end_date = end_date, `$top` = 10) # return all indicators for the specified date range start_date <- "2021-01-01" x <- get_monthly_market_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
## Not run: indic <- c("IPCA", "IPC-Fipe") end_date <- "2018-01-31" x <- get_monthly_market_expectations(indic, end_date = end_date, `$top` = 10) # return all indicators for the specified date range start_date <- "2021-01-01" x <- get_monthly_market_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
Statistics for the quarterly expectations of economic indicators. All statistics are computed based on quarterly expectations provided by many financial institutions in Brazil: banks, funds, risk managers, so on and so forth. These expections and its statistics are used to build the FOCUS Report weekly released by the Brazilian Central Bank.
get_quarterly_market_expectations( indic = NULL, start_date = NULL, end_date = NULL, ... )
get_quarterly_market_expectations( indic = NULL, start_date = NULL, end_date = NULL, ... )
indic |
a character vector with economic indicators names. They are case sensitive and don't forget the accents. |
start_date |
series initial date. Accepts ISO character formated date and |
end_date |
series final date. Accepts ISO character formated date and |
... |
additional parameters to be passed to the API
The |
There are quarterly expectations available for the following indicators:
Câmbio
IPCA
IPCA Administrados
IPCA Alimentação no domicílio
IPCA Bens industrializados
IPCA Livres
IPCA Serviços
PIB Agropecuária
PIB Indústria
PIB Serviços
PIB Total
Taxa de desocupação
Check <https://olinda.bcb.gov.br/olinda/servico/Expectativas/versao/v1/documentacao#ExpectativasMercadoTrimestrais> for more details
A data.frame
with the requested data.
## Not run: indic <- c("PIB Industrial", "PIB Total") end_date <- "2018-01-31" x <- get_quarterly_market_expectations(indic, end_date = end_date, `$top` = 10) # return all indicators for the specified date range start_date <- "2021-01-01" x <- get_quarterly_market_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
## Not run: indic <- c("PIB Industrial", "PIB Total") end_date <- "2018-01-31" x <- get_quarterly_market_expectations(indic, end_date = end_date, `$top` = 10) # return all indicators for the specified date range start_date <- "2021-01-01" x <- get_quarterly_market_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
Statistics of Selic market expectations. All statistics are computed based on expectations provided by many financial institutions in Brazil: banks, funds, risk managers, so on and so forth. These expections and its statistics are used to build the FOCUS Report weekly released by the Brazilian Central Bank.
get_selic_market_expectations(start_date = NULL, end_date = NULL, ...)
get_selic_market_expectations(start_date = NULL, end_date = NULL, ...)
start_date |
series initial date.
Accepts ISO character formated date and |
end_date |
series final date.
Accepts ISO character formated date and |
... |
additional parameters to be passed to the API The |
Check <https://olinda.bcb.gov.br/olinda/servico/Expectativas/versao/v1/documentacao#ExpectativasMercadoSelic> for more details
A data.frame
with the requested data.
## Not run: # return all indicators for the specified date range start_date <- "2022-01-01" x <- get_selic_market_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
## Not run: # return all indicators for the specified date range start_date <- "2022-01-01" x <- get_selic_market_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
Get the series from BCB
get_series( code, start_date = NULL, end_date = NULL, last = 0, as = c("tibble", "xts", "ts", "data.frame", "text") )
get_series( code, start_date = NULL, end_date = NULL, last = 0, as = c("tibble", "xts", "ts", "data.frame", "text") )
code |
series code |
start_date |
series initial date. Accepts ISO character formated date and |
end_date |
series final date. Accepts ISO character formated date and |
last |
last items of the series |
as |
the returning type: data objects (
The arguments |
tibble
is the default returning class, but the argument as
can be set
to xts
, data.frame
, ts
, or text
to return these other types.
text
returns the JSON data provided by the remote API.
# download the entire series ## Not run: get_series(1) ## End(Not run) # download a period of dates ## Not run: get_series(1, start_date = "2016-12-01") ## End(Not run) ## Not run: x <- get_series(1, start_date = "2016-12-01", end_date = "2016-12-31") ## End(Not run) # downlaod the last register ## Not run: x <- get_series(1, last = 1) ## End(Not run)
# download the entire series ## Not run: get_series(1) ## End(Not run) # download a period of dates ## Not run: get_series(1, start_date = "2016-12-01") ## End(Not run) ## Not run: x <- get_series(1, start_date = "2016-12-01", end_date = "2016-12-31") ## End(Not run) # downlaod the last register ## Not run: x <- get_series(1, last = 1) ## End(Not run)
Statistics of annual expectations for top 5 indicators. All statistics are computed based on expectations provided by many financial institutions in Brazil: banks, funds, risk managers, so on and so forth. These expections and its statistics are used to build the FOCUS Report weekly released by the Brazilian Central Bank.
get_top5s_annual_market_expectations( indic = NULL, start_date = NULL, end_date = NULL, ... )
get_top5s_annual_market_expectations( indic = NULL, start_date = NULL, end_date = NULL, ... )
indic |
a character vector with economic indicators names. They are case sensitive and don't forget the accents. |
start_date |
series initial date.
Accepts ISO character formated date and |
end_date |
series final date.
Accepts ISO character formated date and |
... |
additional parameters to be passed to the API
The |
There are inflation's expectations available for the following indicators:
Câmbio
IGP-DI
IGP-M
IPCA
Selic
Check <https://olinda.bcb.gov.br/olinda/servico/Expectativas/versao/v1/documentacao#ExpectativasMercadoTop5Anuais> for more details
A data.frame
with the requested data.
## Not run: indic <- "IPCA" end_date <- "2018-06-22" x <- get_top5s_annual_market_expectations(indic, end_date = end_date, `$top` = 10) # return all indicators for the specified date range start_date <- "2021-01-01" x <- get_top5s_annual_market_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
## Not run: indic <- "IPCA" end_date <- "2018-06-22" x <- get_top5s_annual_market_expectations(indic, end_date = end_date, `$top` = 10) # return all indicators for the specified date range start_date <- "2021-01-01" x <- get_top5s_annual_market_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
Statistics of monthly expectations for top 5 indicators. All statistics are computed based on expectations provided by many financial institutions in Brazil: banks, funds, risk managers, so on and so forth. These expections and its statistics are used to build the FOCUS Report weekly released by the Brazilian Central Bank.
get_top5s_monthly_market_expectations( indic = NULL, start_date = NULL, end_date = NULL, ... )
get_top5s_monthly_market_expectations( indic = NULL, start_date = NULL, end_date = NULL, ... )
indic |
a character vector with economic indicators names. They are case sensitive and don't forget the accents. |
start_date |
series initial date.
Accepts ISO character formated date and |
end_date |
series final date.
Accepts ISO character formated date and |
... |
additional parameters to be passed to the API
The |
There are inflation's expectations available for the following indicators:
Câmbio
IGP-DI
IGP-M
IPCA
Selic
Check <https://olinda.bcb.gov.br/olinda/servico/Expectativas/versao/v1/documentacao#ExpectativasMercadoTop5Mensais> for more details
A data.frame
with the requested data.
## Not run: indic <- "IPCA" end_date <- "2018-06-22" x <- get_top5s_monthly_market_expectations(indic, end_date = end_date, `$top` = 10) # return all indicators for the specified date range start_date <- "2021-01-01" x <- get_top5s_monthly_market_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
## Not run: indic <- "IPCA" end_date <- "2018-06-22" x <- get_top5s_monthly_market_expectations(indic, end_date = end_date, `$top` = 10) # return all indicators for the specified date range start_date <- "2021-01-01" x <- get_top5s_monthly_market_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
Statistics of Selic expectations for top 5 indicators. All statistics are computed based on expectations provided by many financial institutions in Brazil: banks, funds, risk managers, so on and so forth. These expections and its statistics are used to build the FOCUS Report weekly released by the Brazilian Central Bank.
get_top5s_selic_market_expectations(start_date = NULL, end_date = NULL, ...)
get_top5s_selic_market_expectations(start_date = NULL, end_date = NULL, ...)
start_date |
series initial date.
Accepts ISO character formated date and |
end_date |
series final date.
Accepts ISO character formated date and |
... |
additional parameters to be passed to the API The |
Check <https://olinda.bcb.gov.br/olinda/servico/Expectativas/versao/v1/documentacao#ExpectativasMercadoTop5Selic> for more details
A data.frame
with the requested data.
## Not run: # return all indicators for the specified date range start_date <- "2022-01-01" x <- get_top5s_selic_market_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
## Not run: # return all indicators for the specified date range start_date <- "2022-01-01" x <- get_top5s_selic_market_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
Statistics of inflation's market expectations for the next 12 months. All statistics are computed based on expectations provided by many financial institutions in Brazil: banks, funds, risk managers, so on and so forth. These expections and its statistics are used to build the FOCUS Report weekly released by the Brazilian Central Bank.
get_twelve_months_inflation_expectations( indic = NULL, start_date = NULL, end_date = NULL, ... )
get_twelve_months_inflation_expectations( indic = NULL, start_date = NULL, end_date = NULL, ... )
indic |
a character vector with economic indicators names. They are case sensitive and don't forget the accents. |
start_date |
series initial date.
Accepts ISO character formated date and |
end_date |
series final date.
Accepts ISO character formated date and |
... |
additional parameters to be passed to the API
The |
There are inflation's expectations available for the following indicators:
IGP-DI
IGP-M
INPC
IPA-DI
IPA-M
IPCA
IPCA Administrados
IPCA Alimentação no domicílio
IPCA Bens industrializados
IPCA Livres
IPCA Serviços
IPCA-15
IPC-FIPE
Check <https://olinda.bcb.gov.br/olinda/servico/Expectativas/versao/v1/documentacao#ExpectativasMercadoInflacao12Meses> for more details
A data.frame
with the requested data.
## Not run: indic <- c("IPCA", "IGP-M") end_date <- "2018-06-22" x <- get_twelve_months_inflation_expectations(indic, end_date = end_date, `$top` = 10) # return all indicators for the specified date range start_date <- "2021-01-01" x <- get_twelve_months_inflation_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
## Not run: indic <- c("IPCA", "IGP-M") end_date <- "2018-06-22" x <- get_twelve_months_inflation_expectations(indic, end_date = end_date, `$top` = 10) # return all indicators for the specified date range start_date <- "2021-01-01" x <- get_twelve_months_inflation_expectations(start_date = start_date, `$top` = 20) ## End(Not run)
Extraxt bid and ask data from time series objects.
Bid(x, ...) ## S3 method for class 'data.frame' Bid(x, ...) ## S3 method for class 'xts' Bid(x, ...) ## S3 method for class 'olinda_df' Bid(x, ...) Ask(x, ...) ## S3 method for class 'data.frame' Ask(x, ...) ## S3 method for class 'xts' Ask(x, ...) ## S3 method for class 'olinda_df' Ask(x, ...)
Bid(x, ...) ## S3 method for class 'data.frame' Bid(x, ...) ## S3 method for class 'xts' Bid(x, ...) ## S3 method for class 'olinda_df' Bid(x, ...) Ask(x, ...) ## S3 method for class 'data.frame' Ask(x, ...) ## S3 method for class 'xts' Ask(x, ...) ## S3 method for class 'olinda_df' Ask(x, ...)
x |
time series objects containing data to be extracted |
... |
additional arguments |
tibble with time series
## Not run: x <- get_currency("EUR", "2018-06-22", "2018-06-28") Bid(x) Ask(x) ## End(Not run)
## Not run: x <- get_currency("EUR", "2018-06-22", "2018-06-28") Bid(x) Ask(x) ## End(Not run)
Lists all currencies and presents their name, symbol, numeric code, country name and county numeric code
list_currencies()
list_currencies()
A data.frame
with information of all currencies
## Not run: list_currencies() ## End(Not run)
## Not run: list_currencies() ## End(Not run)
Given a currency symbol and a time interval (in dates) this function returns the bid and ask time series of currency rates.
olinda_get_currency( symbol, start_date, end_date = NULL, as = c("tibble", "xts", "data.frame", "text"), parity = FALSE )
olinda_get_currency( symbol, start_date, end_date = NULL, as = c("tibble", "xts", "data.frame", "text"), parity = FALSE )
symbol |
currency symbol |
start_date |
time interval initial date |
end_date |
time interval last date |
as |
the object's returning type |
parity |
The The time series date range is defined by The |
The time series with the bid and ask currency rates regarding the given symbol quoted in BRL.
The default returning is a tibble
-fashioned data.frame
with
the three columns: date
, ask
and bid
.
The as
argument also accepts data.frame
to return old fashioned data frames,
xts
to return a xts object with two variables (bid and ask) and text
which returns
the text content download from BCB site.
## Not run: olinda_get_currency("USD", "2017-03-01", "2017-03-10") ## End(Not run)
## Not run: olinda_get_currency("USD", "2017-03-01", "2017-03-10") ## End(Not run)
Lists all currencies and presents their name, symbol, numeric code, country name and county numeric code
olinda_list_currencies()
olinda_list_currencies()
A data.frame
with information of all currencies.
The currency_type
refers to the currency's parity quotation.
Parity quotations relates currency values with USD.
## Not run: list_currencies() ## End(Not run)
## Not run: list_currencies() ## End(Not run)
'rbcb_dataset(name)' opens an [RStudio gadget](https://shiny.rstudio.com/articles/gadgets.html) and [addin](http://rstudio.github.io/rstudioaddins/) that allows you to view a few attributes that help to explain the desired data.
rbcb_dataset(name)
rbcb_dataset(name)
name |
dataset name |
Addin has no return
Gets SGS, currency, market expectations and many other datasets from the Brazilian Central Bank open data services.
rbcb_get(x, ...) ## S3 method for class 'sgs' rbcb_get(x, from = NULL, to = NULL, last = 0, ...)
rbcb_get(x, ...) ## S3 method for class 'sgs' rbcb_get(x, from = NULL, to = NULL, last = 0, ...)
x |
an object that represents the kind of data to be downloaded |
... |
others arguments |
from |
series initial date. Accepts ISO character formated date and
|
to |
series final date. Accepts ISO character formated date and
|
last |
last items of the series To use the SGS API a 'sgs' object should be passed. |
a dataset with the corresponding data (usually a 'tibble')
## Not run: x <- sgs(USD = 1, SELIC = 1178) rbcb_get(x, from = Sys.Date() - 10) ## End(Not run)
## Not run: x <- sgs(USD = 1, SELIC = 1178) rbcb_get(x, from = Sys.Date() - 10) ## End(Not run)
'rbcb_search(text)' opens an [RStudio gadget](https://shiny.rstudio.com/articles/gadgets.html) and [addin](http://rstudio.github.io/rstudioaddins/) that allows you to query for specific terms and see a suitable rbcb command to fetch the desired data.
rbcb_search(text = "")
rbcb_search(text = "")
text |
text to search |
Addin has no return
Options used in rbcb inside some of its functions.
* 'rbcb_cache': all downloaded data is stored in temporary directories, if 'rbcb_cache' is FALSE downloaded data overwrites files if it already exists. Otherwise, download is not executed and the existing file is returned. Defaults to TRUE. * 'rbcb_verbose': if TRUE verbose messages are displayed when http requests are executed with httr. Defaults to FALSE.
## Not run: options(rbcb_cache = FALSE) options(rbcb_verbose = TRUE) ## End(Not run)
## Not run: options(rbcb_cache = FALSE) options(rbcb_verbose = TRUE) ## End(Not run)
SGS code is an objects that represents the SGS code used to download datasets from the SGS API.
sgs(..., load_info = TRUE)
sgs(..., load_info = TRUE)
... |
numeric codes (preferably named) |
load_info |
'logical' indicating with the dataset info shoud be loaded (default TRUE) |
an SGS object representing SGS codes
## Not run: sgs(USD = 1, IPCA = 433) ## End(Not run)
## Not run: sgs(USD = 1, IPCA = 433) ## End(Not run)
Convert a tidy dataframe into a list of separate time series objects like 'xts' and 'ts' or even a 'tibble' with a time series representation ( two columns with dates and values).
sgs_untidy(x, tidydf, as = c("tibble", "xts", "ts"))
sgs_untidy(x, tidydf, as = c("tibble", "xts", "ts"))
x |
sgs object with the corresponding codes |
tidydf |
tidy dataframe returned by 'rbcb_get' |
as |
the returning type ('tibble', 'xts', 'ts') |
a list with time series objects
## Not run: x <- sgs(USD = 1, SELIC = 1178) df <- rbcb_get(x, from = Sys.Date() - 10) sgs_untidy(x, df, as = "xts") ## End(Not run)
## Not run: x <- sgs(USD = 1, SELIC = 1178) df <- rbcb_get(x, from = Sys.Date() - 10) sgs_untidy(x, df, as = "xts") ## End(Not run)