Skip to content

Commit

Permalink
Merge pull request #83 from ropensci/dev_docu
Browse files Browse the repository at this point in the history
Update documentation
  • Loading branch information
datapumpernickel authored Apr 22, 2024
2 parents c98bd9a + a498177 commit e49fb05
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Interface with and extract data from the United Nations Comtrade API
<https://comtradeplus.un.org/>. Comtrade provides country level shipping data
for a variety of commodities, these functions allow for easy API query and data
returned as a tidy data frame. More info can be found
[here](https://unstats.un.org/wiki/display/comtrade). Full API documentation
[here](https://uncomtrade.org/docs/welcome-to-un-comtrade/). Full API documentation
can be found [here](https://comtradedeveloper.un.org/).

Please [report](https://github.com/ropensci/comtradr/issues) issues, comments,
Expand Down Expand Up @@ -63,7 +63,7 @@ devtools::install_github("ropensci/comtradr@main")
As stated above, you need an API token, see the FAQ of Comtrade for details
on how to obtain it:

➡️ https://unstats.un.org/wiki/display/comtrade/New+Comtrade+User+Guide#NewComtradeUserGuide-UNComtradeAPIManagement
➡️ https://uncomtrade.org/docs/api-subscription-keys/

You need to follow the detailed explanations,
which include screenshots, in the Wiki of Comtrade to the letter. ☝️
Expand Down Expand Up @@ -139,7 +139,7 @@ wine_codes <- ct_commodity_lookup("wine", return_code = TRUE, return_char = TRUE
example2 <- ct_get_data(
reporter = "ARG",
flow_direction = "export",
partner = "all",
partner = "all_countries",
start_date = 2007,
end_date = 2011,
commodity_code = wine_codes
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ Nations Comtrade API <https://comtradeplus.un.org/>. Comtrade provides
country level shipping data for a variety of commodities, these
functions allow for easy API query and data returned as a tidy data
frame. More info can be found
[here](https://unstats.un.org/wiki/display/comtrade). Full API
[here](https://uncomtrade.org/docs/welcome-to-un-comtrade/). Full API
documentation can be found [here](https://comtradedeveloper.un.org/).

Please [report](https://github.com/ropensci/comtradr/issues) issues,
comments, or feature requests. We are very much looking for feedback on
the usability of the new functions.

The package in its old version is still available from the
`legacy-0-3-0` branch.

Please note that this package is released with a [Contributor Code of
Conduct](https://rOpenSci.org/code-of-conduct/). By contributing to this
project, you agree to abide by its terms.
Expand Down Expand Up @@ -54,8 +57,7 @@ do it! 💪**
As stated above, you need an API token, see the FAQ of Comtrade for
details on how to obtain it:

➡️
<https://unstats.un.org/wiki/display/comtrade/New+Comtrade+User+Guide#NewComtradeUserGuide-UNComtradeAPIManagement>
➡️ <https://uncomtrade.org/docs/api-subscription-keys/>

You need to follow the detailed explanations, which include screenshots,
in the Wiki of Comtrade to the letter. ☝️ I am not writing them out
Expand Down Expand Up @@ -130,7 +132,7 @@ wine_codes <- ct_commodity_lookup("wine", return_code = TRUE, return_char = TRUE
example2 <- ct_get_data(
reporter = "ARG",
flow_direction = "export",
partner = "all",
partner = "all_countries",
start_date = 2007,
end_date = 2011,
commodity_code = wine_codes
Expand Down
12 changes: 6 additions & 6 deletions vignettes/comtradr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ library(comtradr)

## Data availability

See [here for an overview](https://unstats.un.org/wiki/display/comtrade/New+Comtrade+FAQ+for+Advanced+Users?preview=/135004494/135004492/Picture1.png) of available commodity classifications.
See [here for an overview](https://uncomtrade.org/docs/why-are-some-converted-datasets-not-accessible-in-the-ui/) of available commodity classifications.


## Package information

API wrapper for the [UN Comtrade Database](https://comtradeplus.un.org/). UN Comtrade provides historical data on the weights and value of specific goods shipped between countries, more info can be found [here](https://unstats.un.org/wiki/display/comtrade). Full API documentation can be found [here](https://comtradedeveloper.un.org/).
API wrapper for the [UN Comtrade Database](https://comtradeplus.un.org/). UN Comtrade provides historical data on the weights and value of specific goods shipped between countries, more info can be found [here](https://uncomtrade.org/docs/welcome-to-un-comtrade/). Full API documentation can be found [here](https://comtradedeveloper.un.org/).

## Install and load comtradr

Expand All @@ -48,7 +48,7 @@ library(comtradr)
As stated above, you need an API token, see the FAQ of Comtrade for details
on how to obtain it:

➡️ https://unstats.un.org/wiki/display/comtrade/New+Comtrade+User+Guide#NewComtradeUserGuide-UNComtradeAPIManagement
➡️ https://uncomtrade.org/docs/api-subscription-keys/

You need to follow the detailed explanations,
which include screenshots, in the Wiki of Comtrade to the letter. ☝️
Expand Down Expand Up @@ -212,12 +212,12 @@ ct_commodity_lookup(c("tomato", "sldfkjkfdsklsd"), verbose = TRUE)
The Comtrade API imposes rate limits on users. `comtradr` features automated
throttling of API calls to ensure the user stays within the limits defined by
Comtrade. Below is a breakdown of those limits, API docs on these details can
be found [here](https://unstats.un.org/wiki/display/comtrade/New+Comtrade+FAQ+for+First+Time+Users).
be found [here](https://uncomtrade.org/docs/subscriptions/).

* Without user token: unlimited calls/day, up to 500 records per call
(registration and API subscription key not required) -- this end-point is not
implemented here.
* With valid user token: 250 calls/day, up to 250,000 records per call
* With valid user token: 500 calls/day, up to 100,000 records per call
(free registration and API subscription key required).

The API also limits the amount of times it can be queried per minute,
Expand Down Expand Up @@ -265,7 +265,7 @@ were updated.

Additionally, the Comtrade API features a number of different commodity
reference tables, based on different trade data classification schemes
(for more details, see [this](https://unstats.un.org/wiki/display/comtrade/New+Comtrade+FAQ+for+Advanced+Users?preview=/135004494/135004492/Picture1.png) page from the API docs).
(for more details, see [this](https://uncomtrade.org/docs/list-of-references-parameter-codes/) page from the API docs).
`comtradr` ships with all available commodity reference tables.
The user may return and access any of the available commodity tables
by specifying arg `commodity_type` within function `ct_get_ref_table`
Expand Down
2 changes: 1 addition & 1 deletion vignettes/large_data.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ to calculate on rather large datasets:
2) of which each can take up to 100.000 rows.

This information might be updated in the Comtrade API, check
the most up to date values [here](https://unstats.un.org/wiki/display/comtrade/New+Comtrade+FAQ+for+First+Time+Users#NewComtradeFAQforFirstTimeUsers-WhichsubscriptionscanIchoosefrom?).
the most up to date values [here](https://uncomtrade.org/docs/subscriptions/).

So when trying to fetch the maximum amount of data in the minimum amount of
days, you want to minimize the amount of requests you need by making them
Expand Down

0 comments on commit e49fb05

Please sign in to comment.