hsInRange: Looks for corresponding FCL codes in country-specific mapping...

Description Usage Arguments Details Value

Description

Looks for corresponding FCL codes in country-specific mapping tables from MDB files

Usage

1
hsInRange(hs, areacode, flowname, mapdataset, parallel = FALSE)

Arguments

hs

Numeric or character vector with HS codes to convert to FCL.

areacode

Numeric or character vector with reporters' codes.

flowname

Numeric or character vector of trade direction.

mapdataset

Data frame with HS->FCL mapping with columns area, flow, fromcode, tocode, fcl registered with doParallel package.

Details

Input hs, areacode and flowname columns are used to build data frame with hs-codes to convert. Probably it is easier to pass a data frame, then separate vectors.

Value

Data frame with columns id, area, flow, hsorig, hsext, fcl. id holds row numbers of original dataset. hsorig is input hs. hsext is input hs with additional zeros if requires. If there are multiple HS->FCL matchings, all of them are returned with similar id. If there were no matching FCL codes, NA in fcl column is returned.


SWS-Methodology/hsfclmap documentation built on May 9, 2019, 11:53 a.m.