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

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
## Not run: 
library(tradeflows)
# Load "other sawnwood" in France for the last 5 years available in comtrade
loadcomtradebycode(440799, 251, "recent")

## End(Not run)

EuropeanForestInstitute/tradeflows documentation built on Oct. 8, 2018, 10:05 a.m.