Learn R Programming

oec (version 2.6.7)

getdata: Downloads and processes the data from the API

Description

Downloads and processes the data from the API

Usage

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

Arguments

origin

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

destination

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

year

The OEC's API ranges from 1962 to 2016

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). By default set to 1.

write

Write to user's filespace (by default set to FALSE)

wrapper

Argument used by getdata_interval (by default set to FALSE)

Examples

Run this code
# NOT RUN {
# Run `countries_list` to display the full list of countries
# What does Chile export to China?  year 2015 - classification HS92 6 characters
getdata("chl", "chn", 2015, 3)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab