get_tariffs | R Documentation |
This function allows the user to access the traded and non-traded tariff lines tariff data from the UNCTAD TRAINS dataset. Data are harmonized across the countries at 6-digit level of the Harmonized System (HS6) and are available for preferential and most-favored-nation (MFN) rates.
get_tariffs(reporter, partner, product, year, datatype)
reporter |
A character vector with reporters three-digit ISO Country
Codes or |
partner |
A character vector with partners three-digit ISO Country
Codes, |
product |
A character vector with six-digit product codes (HS6) or
|
year |
A character, numeric or integer vector with years in the four-digit format. |
datatype |
Should be "reported" (the default) or "aveestimated". "reported" provides only tariff rates and "aveestimated" provides tariff rates and ad valorem equivalents of specific duties estimated using UNCTAD methods. |
The WITS API retrieves MFN tariff lines only for the partner world
.
Besides, to avoid server overload, it is not possible to request the entire database in one query. The options to request data are the following:
All products tariff schedules can be requested for a single reporter, partner and year;
Tariff schedule for a single reporter, partner, and product can be requested for a range of years;
Tariff schedule for one or more reporters, one or more partners, one or more products can be requested for a single year;
Either reported or AVE estimated data type can be requested in a single request.
get_tariffs()
returns a data frame with the following columns:
reporter_country_code: reporter three-digit ISO Country Code;
partner_country_code: partner three-digit ISO Country Code;
product_code: 6-digit HS code;
year: year in which the tariff was valid;
tariff_simple_average: simple average of ad valorem tariff rates from all national tariff lines within the corresponding HS 6-digit code;
tariff_type: identifies whether the tariff rate is Preferential (PREF) or most-favored-nation (MFN);
n_total_lines: total number of national tariff lines within the corresponding HS 6-digit code;
n_pref_lines: number of national tariff lines within the corresponding HS 6-digit code for which preferential rates are applicable;
n_mfn_lines: number of national tariff lines within the corresponding HS 6-digit code for which preferential rates are NOT applicable (so that MFN rates are used in the calculation of the simple average);
n_specific_duty_lines: number of national tariff lines within the corresponding HS 6-digit code for which preferential rates are NOT in ad valorem form (so that the line is not included in the calculation of the simple average);
tariff_sum_rates: sum of ad valorem tariff rates from all national tariff lines within the corresponding HS 6-digit code;
tariff_min_rate: lowest ad valorem tariff rates among all national tariff lines within the corresponding HS 6-digit code;
tariff_max_rate: highest ad valorem tariff rates among all national tariff lines within the corresponding HS 6-digit code;
nomen_code: revision of HS used (H0 = HS 1988/92, H1= HS 1996, H2 = HS 2002, H3 = HS 2007, H4 = HS 2012).
http://wits.worldbank.org/data/public/WITSAPI_UserGuide.pdf for the official WITS-API USER GUIDE. This guide is especially useful for understanding the use of the parameters and request errors.
## Not run: # Request two reporters (Brazil and United States) - all partners - one # product ("870350") - one year (2017) - reported tariff rate: get_tariffs( reporter = c("076", "840"), partner = "all", product = "870350", year = "2017" ) ## Note that, if the reporter vector above is replaced by "all", it will ## throw the following error: "The provided parameter values return large data". # Request all reporters - one partner (Japan) - one product ("851830") # - one year (2017) - reported and AVE estimated tariff rates: get_tariffs( reporter = "all", partner = "392", product = "851830", year = "2017", datatype = "aveestimated" ) ## Note that the request above returns only preferencial rates, since MFN ## tariff rates are only provided for the partner world. # Request one reporter (European Union) - one partner (world) - all products # - one year (2015) - reported tariff rates: get_tariffs( reporter = "918", year = "2015" ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.