BETS.get: Get a complete time series from a BETS database

Description Usage Arguments Value Note See Also Examples

View source: R/BETS.get.R

Description

Extracts a complete time series from either the Central Bank of Brazil (BCB), the Brazilian Institute of Geography and Statistics (IBGE) or the Brazilian Institute of Economics (FGV/IBRE).

Usage

1
BETS.get(code, from = "", to = "", data.frame = FALSE, frequency = NULL)

Arguments

code

A character. The unique code that references the time series. This code can be obtained by using the BETS.search function.

from

A character or a Data object. Starting date of the time series (format YYYY-MM-DD).

to

A character or a Data object. Ending date of the time series (format YYYY-MM-DD).

data.frame

A boolean. True if you want the output to be a data frame. True to ts output.

frequency

An integer. The frequency of the time series. It is not needed. It is going to be used only if the metadata for the series is corrupted.

Value

A ts (time series) object containing the desired series.

Note

Due to the significant size of the databases, it could take a while to retrieve the values. However, it shouldn't take more than 90 seconds.

See Also

ts, BETS.search and seas

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 # Anual series: GDP at constant prices, in R$ (brazilian reais)
 #BETS.get(1208)
 
 # International reserves - Cash concept 
 #int.reserves <- BETS.get("3543")
 #plot(int.reserves)
 
 # Exchange rate - Free - United States dollar (purchase)
 #us.brl <- BETS.get(3691)
 

pedrocostaferreira/BETS documentation built on June 1, 2020, 7:53 a.m.