Learn R Programming

oec (version 2.2)

treemap: Creates a treemap for a given year

Description

Creates a treemap for a given year

Usage

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

Arguments

origin

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

destination

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

variable

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

classification

refers to the trade classification that can be "6" (HS92 6 characters) or "8" (HS92 8 characters) for the year 1995 and going or "4" (SITC rev.2 4 characters) for the year 1962 and ongoing

year

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

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 {
treemap("chl", "chn", "exports", 6, 2014)
# }

Run the code above in your browser using DataLab