Learn R Programming

tradestatistics (version 5.0.0)

ots_commodity_code: String matching of official commodity/section names and Harmonized System (HS) codes according to the United Nations nomenclature

Description

Takes a text string and searches within the package data for all matching commodity codes in the context of valid API commodity codes.

Usage

ots_commodity_code(commodity = NULL, section = NULL)

Value

A tibble with all possible matches (no uppercase distinction) showing the commodity name and commodity code

Arguments

commodity

A text string such as "Animals", "COPPER" or "fruits".

section

A text string such as "meat", "FISH" or "Dairy".

Examples

Run this code
ots_commodity_code(commodity = "ANIMALS ")
ots_commodity_code(section = "  fish")
ots_commodity_code(commodity = "Milk", section = "Dairy")

Run the code above in your browser using DataLab