From 683cdfbc79c20c69e90d3af7c63077e852a58917 Mon Sep 17 00:00:00 2001 From: paul bochtler <65470117+datapumpernickel@users.noreply.github.com> Date: Mon, 13 May 2024 12:21:40 +0200 Subject: [PATCH] update readme with example for bulk file --- README.Rmd | 21 ++++++++++++++++++--- README.md | 24 ++++++++++++++++++------ 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/README.Rmd b/README.Rmd index cf5cd5c..351edff 100644 --- a/README.Rmd +++ b/README.Rmd @@ -50,9 +50,6 @@ To install the dev version from github, use: devtools::install_github("ropensci/comtradr@dev") ``` -Note that the development version includes a preliminary way to query -the bulk download, but it is undocumented and might break. - ## Usage @@ -150,6 +147,24 @@ example2 <- ct_get_data( str(example2) ``` +### Bulk Example +To download bulk files, use the function `ct_get_bulk`. Usage is documented in +the package vignettes, see here for an example: + +Attention, this downloads large files (often more than one Gigabyte in size) and +requires a premium key. + +```{r, eval = FALSE} +hs0_all <- comtradr::ct_get_bulk( + reporter = c("DEU"), # only some examples here, + commodity_classification = 'H0', + frequency = 'A', + verbose = T, + start_date = 2020, # only one year here + end_date = 2020) +``` + + ## Data availability diff --git a/README.md b/README.md index 7ef7307..1c31e95 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,6 @@ 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. @@ -47,9 +44,6 @@ To install the dev version from github, use: devtools::install_github("ropensci/comtradr@dev") ``` -Note that the development version includes a preliminary way to query -the bulk download, but it is undocumented and might break. - ## Usage ### Authentication 🔐 @@ -145,6 +139,24 @@ example2 <- ct_get_data( str(example2) ``` +### Bulk Example + +To download bulk files, use the function `ct_get_bulk`. Usage is +documented in the package vignettes, see here for an example: + +Attention, this downloads large files (often more than one Gigabyte in +size) and requires a premium key. + +``` r +hs0_all <- comtradr::ct_get_bulk( + reporter = c("DEU"), # only some examples here, + commodity_classification = 'H0', + frequency = 'A', + verbose = T, + start_date = 2020, # only one year here + end_date = 2020) +``` + ## Data availability See [here for an