Description Usage Arguments Value Examples
This function accesses atlas.media.mit.edu
and perfoms different API
calls to return tidy data. and data transforming.
1 2 | get_data(origin = "all", destination = "all", years = 2000,
classification = "sitc", max_attempts = 5)
|
origin |
ISO code for country of origin (e.g. |
destination |
ISO code for country of destination (e.g. |
years |
Numeric value greater or equal to 1962 and lower of equal to 2016. Default set to 2000. |
classification |
Any of the available trade classifications in the OEC ( |
max_attempts |
How many times to try to download data in case the API or the internet
connection fails when obtaining data. Default set to |
A tibble that describes bilateral trade metrics (imports, exports, trade balance
and relevant metrics
such as exports growth w/r to last year) between an origin
and destination
country.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
# The next examples can take more than 5 seconds to compute, and specially for large
economies so these are just shown without evaluation according to CRAN rules
# Run `country_codes` to display the full table of countries
# What does Chile export to China?
# year 2015 - SITC (4 characters)
get_data("chl", "chn", 2015)
# or with explicit parameter
get_data("chl", "chn", 2015, "sitc")
# What does Chile export to China?
# years 2010, 2011 and 2015 - HS07 (4 and 6 characters)
get_data("chl", "chn", c(2010, 2011, 2015), "hs07")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.