Skip to content

Commit

Permalink
update readme with example for bulk file
Browse files Browse the repository at this point in the history
  • Loading branch information
datapumpernickel committed May 13, 2024
1 parent ee1ee61 commit 683cdfb
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 9 deletions.
21 changes: 18 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 🔐
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 683cdfb

Please sign in to comment.