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

Issue with requesting commodity data #73

Closed john-friedman closed 1 year ago

john-friedman commented 1 year ago

The current branch seems to have an issue with requesting commodity data

e.g. ots_create_tidy_data(years = 2002, reporters = "chl", commodities = "apple", table = "yrc")

returns

Error in tradestatistics::ots_commodity_code(group = commodities_wm[x]) : 
  unused argument (group = commodities_wm[x])

I think this first error is caused by a typo where group should be section as ots_commodity_code has params commodity, section

This led to another error in ots_strings_processing where it looks as though lookup for sections has not been implemented.

I've forked your package and applied the bug fixes. I'm new to using github, so sorry for any breaches of etiquette. Thanks for maintaining this useful package

pachadotdev commented 1 year ago

hi @jgoman99 ! thanks for reporting this do you refer to this change? https://github.com/jgoman99/tradestatistics/commit/f9d1436243cbcf2195eb63542d1da15299ee2ec6 I like it, let me tweak it a bit and I'll add the change. How should I mention you? I will add you to DESCRIPTION as ctb.

john-friedman commented 1 year ago

Hi @pachadotdev,

Yep, that's it! Glad to have helped. If you want to mention me, my name is John Friedman.

Thanks for maintaining this package!