getdata: Downloads and processes the data from the API

Description Usage Arguments Examples

View source: R/getdata.R

Description

Downloads and processes the data from the API

Usage

1
getdata(origin, dest, year, classification)

Arguments

origin

Country code of origin (e.g. "chl" for Chile)

dest

Country code of destination (e.g. "chn" for China)

year

The OEC's API ranges from 1962 to 2015

classification

Trade classification that can be "1" (HS92 4 characters since year 1995), "2" (SITC rev.2 4 characters since year 1962) or "3" (HS92 6 characters since year 1995)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Run countries_list() to display the full list of countries
# For the example Chile is "chl" and China is "chn"

# Download trade between Chile and China
# Year 2015 (HS92 4 characters)
# getdata("chl", "chn", 2014)
# getdata("chl", "chn", 2014, 1) # equivalent to last command

# Download trade between Chile and China
# Year 2015 (SITC rev2 4 characters)
# getdata("chl", "chn", 2015, 2)

# Download trade between Chile and China
# Year 2015 (HS92 6 characters)
# getdata("chl", "chn", 2015, 3)

oec documentation built on July 18, 2017, 1:03 a.m.