Learn R Programming

tradestatistics (version 3.0.2)

ots_commodity_code: String matching of official commodity/group 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, group = 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".

group

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

Examples

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

Run the code above in your browser using DataLab