loadcomtradebycode: load raw data from the COMTRADE API

Description Usage Arguments Value Examples

View source: R/load.R

Description

load a JSON file from the comtrade API in the temp directory The API is documented at http://comtrade.un.org/data/doc/api/ Converts the file to a dataframe Further information for developers is available at https://comtrade.un.org/Data/Doc/API

Usage

1
2
loadcomtradebycode(productcode, reportercode, year, freq = "A",
  px = "HS", max = 50000, logfile = FALSE)

Arguments

productcode

code of the product

reportercode

geographical area or country code

year

a vector of years (maximum 5), or the chain of character "recent"

freq

the frequency: "A" Annual, "M" Monthly

px

Trade data classification scheme

max

maximum records returned

Value

a dataframe

Examples

1
2
3
4
5
6
7
## Not run: 
library(tradeflows)
# Load trade data from Comtrade
# "other sawnwood" trade France in 2018
loadcomtradebycode(440799, 251, 2018)

## End(Not run)

paul4forest/tradeflows documentation built on Oct. 8, 2019, 10:35 a.m.