getdata: Downloads and processes the data from the API

Description Usage Arguments See Also Examples

View source: R/getdata.R

Description

Returns a tibble containing imports, exports and relevant metrics (e.g. exports growth w/r to last year) for a year as the result of different API calls and data transforming. The API returns data for different trade classifications: (i) SITC (1962-2016); (ii) HS92 (1992-2016); (iii) HS96 (1996-2016); (iv) HS02 (2002-2016); (v) HS07 (2007-2016).

Usage

1
getdata(origin, destination, year, classification, wrapper)

Arguments

origin

ISO code for country of origin (e.g. chl for Chile). Run country_codes in case of doubt.

destination

ISO code for country of destination (e.g. chn for China). Run country_codes in case of doubt.

year

Numeric value greater or equal to 1962 and lower of equal to 2016.

classification

Any of the available trade classifications in the OEC (sitc, hs92, hs96, hs02 or hs07). Default set to sitc.

wrapper

Argument used by getdata_batch. Default set to FALSE.

See Also

getdata_batch

Examples

 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)
getdata("chl", "chn", 2015)
# or with explicit parameter
getdata("chl", "chn", 2015, "sitc")

# What does Chile export to China?  
# year 2015 - HS07 (4 and 6 characters)
getdata("chl", "chn", 2015, "hs07")

## End(Not run)

oec documentation built on May 11, 2018, 5:04 p.m.

Related to getdata in oec...