Learn R Programming

oec (version 2.5.2)

treemap: Creates a treemap for a given year

Description

Creates a treemap for a given year

Usage

treemap(origin, dest, variable, year, classification, depth)

Arguments

origin

is the country code of origin (e.g. "chl" for Chile)

dest

is the country code of destination (e.g. "chn" for China)

variable

is the variable to visualize and it can be "imports", "exports" or "exchange" (trade exchange)

year

is the year and the OEC's API ranges from 1962 to 2014

classification

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

depth

is an optional parameter that can take values "0" (group's detail) or "1" (product's detail)

Value

Creates an HTML file with a treemap visualization for a given year.

Examples

Run this code
# NOT RUN {
# Run countries_list() to display the full list of countries
# For the example Chile is "chl" and China is "chn"

# What does Chile export to China?
# Year 2015 (HS92 4 characters)
# treemap("chl", "chn", "exports", 2015)
# treemap("chl", "chn", "exports", 2015, 1) # equivalent to last command
# }

Run the code above in your browser using DataLab