ropensci / tradestatistics

R package to access Open Trade Statistics API
https://docs.ropensci.org/tradestatistics
Apache License 2.0
76 stars 14 forks source link

Example does not work #66

Closed LukasTang closed 2 years ago

LukasTang commented 2 years ago

I just tried to play around with your package and there seems to be some issue in the API request: > ots_create_tidy_data() Error in parse_con(txt, bigint_as_char) : lexical error: invalid char in json text. year 2002 2020 (right here) ------^

`sessionInfo() R version 4.2.0 (2022-04-22 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 22000)

Matrix products: default

locale: [1] LC_COLLATE=German_Germany.utf8 LC_CTYPE=German_Germany.utf8
[3] LC_MONETARY=German_Germany.utf8 LC_NUMERIC=C
[5] LC_TIME=German_Germany.utf8

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

other attached packages: [1] tradestatistics_3.0.2

loaded via a namespace (and not attached): [1] Rcpp_1.0.8.3 lattice_0.20-45 here_1.0.1
[4] png_0.1-7 digest_0.6.29 rprojroot_2.0.3
[7] rappdirs_0.3.3 R6_2.5.1 grid_4.2.0
[10] crul_1.3 jsonlite_1.8.0 magrittr_2.0.3
[13] cachem_1.0.6 rlang_1.0.2 cli_3.2.0
[16] curl_4.3.2 data.table_1.14.2 Matrix_1.4-1
[19] reticulate_1.24 tools_4.2.0 purrr_0.3.4
[22] fastmap_1.1.0 compiler_4.2.0 memoise_2.0.1
[25] httpcode_0.3.0 `

Is there something wrong with the standard function call?

pachadotdev commented 2 years ago

@LukasTang hi! thx for reporting I installed with install_github("pachadotdev/tradestatistics") and it works, I just sent an updated version to CRAN install_github("ropensci/tradestatistics") also works