Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New interface to access series #17

Open
wilsonfreitas opened this issue May 4, 2018 · 2 comments
Open

New interface to access series #17

wilsonfreitas opened this issue May 4, 2018 · 2 comments

Comments

@wilsonfreitas
Copy link
Owner

wilsonfreitas commented May 4, 2018

Currently it has 2 functions

  • get_series: for SGS series
  • get_currency: for currency API

Since it has plans to have new interfaces implemented, a interesting approach is unify all interfaces into one single function

rbcb_get(...)

This function might be a generic and the objects represent the desired data.
Example:

rbcb_get(currecy('BRL'), start_date, end_date)              # uses currency API
rbcb_get(series(IBOVESPA = 7), start_date, end_date)  # uses SGS API

If in the future we have a search, the search could return these objects

brl <- rbcb_search('BRL')
rbcb_get(brl, start_date, end_date)
@wilsonfreitas
Copy link
Owner Author

wilsonfreitas commented May 13, 2022

rbcb_get implemented for SGS API (see 232ee7e).

See sgs.R.

@wilsonfreitas
Copy link
Owner Author

rbcb_get returns a tidy tibble for SGS data.

It is necessary to create a way to transform this tidy tibble into the other used formats like xts and ts.

x <- sgs(IBOVESPA = 7, USD = 1)
df <- rbcb_get(x, from, to)
rbcb_transform(x, df, to = "xts")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant