Code Monkey home page Code Monkey logo

Comments (5)

ChrisMuir avatar ChrisMuir commented on June 15, 2024

Hello Krisselack, are you referring to using different HS codes for commodities? If so, check out function ct_update_databases, it allows you to download and use any of the available commodity code data sets from the Comtrade website.

If you're referring to something different, please let me know.

from comtradr.

liyu0510 avatar liyu0510 commented on June 15, 2024

Hi, I guess I have a similar issue here. I notice that in v0.0.2 there is an argument codetype in the function ct_search which allows you to specify which classification you want (HS, SITC and BEC etc). But in v0.2.2 this is no longer available. So is it still possible to specify classification other than HS in ct_search function to get data?

Thanks in advance.

from comtradr.

ChrisMuir avatar ChrisMuir commented on June 15, 2024

Hi @Zoefish0510 , yes there is a built-in way to specify and utilize any of the commodity classifications that Comtrade uses. Check out the Package Data section of the package vignette, specifically this paragraph:

<vignette>
Additionally, the Comtrade API features a number of different commodity reference tables, based on different trade data classification schemes (for more details, see this page from the API docs). comtradr ships with the commodity table for the “Harmonized System”, or “HS”, scheme. The user may download any of the available commodity tables by specifying arg commodity_type within function ct_update_databases (e.g., ct_update_databases(commodity_type = "SITC") will download the commodity table that follows the “Standard International Trade Classification” scheme). Doing this will replace the commodity table on file with the one specified.
</vignette>

The function ct_search() will always use the commodity classification that currently exists on file.....HS is the default, but if you were to run ct_update_databases(commodity_type = "SITC") to download the SITC classification, then ct_search() would be using SITC.

from comtradr.

shadishakerin avatar shadishakerin commented on June 15, 2024

Hello,

I need to download the data with SITC commodity type, after producing the following:
q <- ct_search(reporters = "USA", partners = c("Germany", "France", "Japan", "Mexico"), trade_direction = "imports")
So I used the command below for that:
ct_update_databases(commodity_type = "SITCrev2")
but I get the following error and my data is not really updated:

Updates found. The following datasets have been downloaded: commodities DB, countries DB
Warning message:
JSON string contains (illegal) UTF8 byte-order-mark!

Do you have any suggestions? I search this error but did not find something useful for my problem. Also is the a way to download the data in SITC format from the beginning? I could not find a way to change the HS default.
I would appreciate any help.

Best,
Shadi

from comtradr.

shadishakerin avatar shadishakerin commented on June 15, 2024

Hi @Zoefish0510 , yes there is a built-in way to specify and utilize any of the commodity classifications that Comtrade uses. Check out the Package Data section of the package vignette, specifically this paragraph:

<vignette>
Additionally, the Comtrade API features a number of different commodity reference tables, based on different trade data classification schemes (for more details, see this page from the API docs). comtradr ships with the commodity table for the “Harmonized System”, or “HS”, scheme. The user may download any of the available commodity tables by specifying arg commodity_type within function ct_update_databases (e.g., ct_update_databases(commodity_type = "SITC") will download the commodity table that follows the “Standard International Trade Classification” scheme). Doing this will replace the commodity table on file with the one specified.
</vignette>

The function ct_search() will always use the commodity classification that currently exists on file.....HS is the default, but if you were to run ct_update_databases(commodity_type = "SITC") to download the SITC classification, then ct_search() would be using SITC.

Hello,

I need to download the data with SITC commodity type, after producing the following:
q <- ct_search(reporters = "USA", partners = c("Germany", "France", "Japan", "Mexico"), trade_direction = "imports")
So I used the command below for that:
ct_update_databases(commodity_type = "SITCrev2")
but I get the following error and my data is not really updated:

Updates found. The following datasets have been downloaded: commodities DB, countries DB
Warning message:
JSON string contains (illegal) UTF8 byte-order-mark!

Do you have any suggestions? I search this error but did not find something useful for my problem. Also is the a way to download the data in SITC format from the beginning? I could not find a way to change the HS default.
I would appreciate your help.

Best,
Shadi

from comtradr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.