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

Add comm_code option AG6 as available for HS classification. #30

Merged
merged 3 commits into from
Jul 18, 2021

Conversation

amannj
Copy link
Contributor

@amannj amannj commented Nov 29, 2020

Hi,

Option comm_code should ideally also recognise aggregation level AG6 of the HS classification. Please see example below.

Thanks a lot.


Example using updated ct_search():

> ct_search(reporters       = "Spain",
+           freq            = "monthly",
+           start_date      = "2020-01", 
+           end_date        = "2020-01",
+           partners        = "China",
+           trade_direction = "exports",
+           commod_codes    = "AG6") %>% 
+   as_tibble() %>%
+   select(classification, period, aggregate_level, trade_flow, reporter, partner, 
+          commodity_code, trade_value_usd, netweight_kg) %>%
+   slice(1:2)
# A tibble: 2 x 9
  classification period aggregate_level trade_flow reporter partner commodity_code trade_value_usd netweight_kg
  <chr>           <int>           <int> <chr>      <chr>    <chr>   <chr>                    <int>        <int>
1 HS             202001               6 Exports    Spain    China   020630                  149985       124614
2 HS             202001               6 Exports    Spain    China   050690                   17720        19104

Data query using comtrade.un.org:
image

@codecov-io
Copy link

codecov-io commented Nov 29, 2020

Codecov Report

Merging #30 (6dfc20e) into sitc-bug (97c2ee1) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           sitc-bug      #30   +/-   ##
=========================================
  Coverage     77.33%   77.33%           
=========================================
  Files             9        9           
  Lines           472      472           
=========================================
  Hits            365      365           
  Misses          107      107           
Impacted Files Coverage Δ
R/ct_search.R 85.23% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 97c2ee1...6dfc20e. Read the comment docs.

@ChrisMuir
Copy link
Member

This is great, thanks a bunch! Do you mind pushing a couple more edits to this PR?

  • If you'd like, please add your self to the DESCRIPTION file as a contributor. Should look like this.
  • Modify the NEWS.md file to add your feature. Something like:
## NEW FEATURES

* Modifications to `ct_search()` to add support for commodity code `ag6` ([#30](https://github.com/ropensci/comtradr/pull/30))

@amannj
Copy link
Contributor Author

amannj commented Nov 30, 2020

Hi Chris,

Thanks a lot! I've just pushed the edits to the PR.

Copy link
Member

@ChrisMuir ChrisMuir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ChrisMuir ChrisMuir merged commit 7ef07ce into ropensci:sitc-bug Jul 18, 2021
@ChrisMuir ChrisMuir mentioned this pull request Jul 18, 2021
@amannj amannj deleted the sitc-bug branch November 16, 2021 09:33
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

Successfully merging this pull request may close these issues.

3 participants