Description Usage Arguments Value See Also Examples
This function checks the UN COMMTRADE API to see if requested trade data is available for download.
1 2 3 4 5 6 7 | check_data(
type = "all",
frequency = "all",
time_period = "all",
reporter = "all",
classification = "all"
)
|
type |
Refers to type of trade and takes a character string. Takes values of "C" (commodities), "S"(Services) or "any" (all trade). Default Value is "all" |
frequency |
Refers to the frequency of reporting and takes a character string. Takes values of "A" (annual trade), "M" (monthly trade) or "all" (any trade). Default is "all" |
time_period |
Refers to the time periods desired and takes a character string. Takes values of the format "YYYY" for years or "YYYYMM" for specific months or "all" all years. Can take a maximum of 5 entries of specific dates entered as a single comma seperated character string. Default is "all" |
reporter |
character string. takes on the UN numeric country code for a country or the code "all" (all countries). see (https://comtrade.un.org/Data/cache/reporterAreas.json). Can take a maximum of 5 specific country codes entered as a single comma separated character string. Default is "all". |
classification |
Refers to the classification scheme used to define traded products and takes a character string. For commodities trade can be it "HS" (harmonized trade or HS classification), "ST" (standard international trade classification or SITC classification), or"BEC" (Broad economic catagories). Can also enter specific revision numbers (ie "S1" for SITC1 or "H1" for HS1). For service trade it can be "EB02" (Extended Balance of Payments Services Classification). Default is "all" which returns available data in all classifications. |
A tidy dataframe containing metadata about the requested records
Documents for UN COMMTRADE API. Available at https://comtrade.un.org/Data/Doc/API
1 2 3 4 5 | #returns information on all available trade data due to default parameters
default <- check_data()
#returns information on annual data reported by the US and China between 2015-2019
specific_query<- check_data(type = "C", frequency = "A", reporter = "842,156", time_period = "2015,2016,2017,2018,2019")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.