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

Importing quarterly data as ts #61

Closed
viniciusoike opened this issue Jan 22, 2024 · 1 comment
Closed

Importing quarterly data as ts #61

viniciusoike opened this issue Jan 22, 2024 · 1 comment
Assignees
Labels

Comments

@viniciusoike
Copy link

viniciusoike commented Jan 22, 2024

There seems to be an issue when importing quarterly data as ts. Both rbcb::get_series(28566, as = "tibble") and rbcb::get_series(28566, as = "xts") work but rbcb::get_series(28563, as = "ts") returns:

Error in map():
ℹ In index: 1.
Caused by error in round():
! non-numeric argument to mathematical function

Other examples include: 1232, 7331, 7332, 7333, 7334, 7335.

sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS 14.1.2

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] rstudioapi_0.15.0 xml2_1.3.6 magrittr_2.0.3 tidyselect_1.2.0
[5] lattice_0.21-8 R6_2.5.1 rlang_1.1.3 fansi_1.0.6
[9] httr_1.4.7 dplyr_1.1.4 tools_4.2.2 xts_0.13.2
[13] grid_4.2.2 utf8_1.2.4 cli_3.6.2 digest_0.6.34
[17] tibble_3.2.1 lifecycle_1.0.4 purrr_1.0.2 vctrs_0.6.5
[21] curl_5.2.0 glue_1.7.0 compiler_4.2.2 pillar_1.9.0
[25] rbcb_0.1.13 generics_0.1.3 jsonlite_1.8.8 pkgconfig_2.0.3
[29] zoo_1.8-12

@wilsonfreitas wilsonfreitas self-assigned this Jan 23, 2024
wilsonfreitas added a commit that referenced this issue Jan 23, 2024
ts objcects need specific frequency for quarterly data, this is not being handled.
Now it is correct.

* Jan/Feb/Mar refer to the first quarter
* Apr/May/Jun refer to the second quarter
* Jul/Aug/Sep refer to the third quarter
* Oct/Nov/Dec refer to the fourth quarter

Issue #61
@wilsonfreitas
Copy link
Owner

Hi, it is correct, quarterly data wasn't being handled.
Now it's been solved.
Thanks for reporting.

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

No branches or pull requests

2 participants