Hi,
I notice that ots_create_tidy_data() returns identical export/import values for country pairs originating from the same "reporter," for example:
d <- ots_create_tidy_data(years = 2000, reporters = "usa", partners = c("afg", "can"), products=c("0101", "0705"), table="yrc", max_attempts=5)
which returns
d[, c(2, 10, 13:16)]
reporter_iso product_code export_value_usd export_rca import_value_usd import_rca
1: usa 0101 672770373 2.1196 485633089 1.1655
2: usa 0101 672770373 2.1196 485633089 1.1655
3: usa 0705 223787742 1.4500 43872463 0.2130
4: usa 0705 223787742 1.4500 43872463 0.2130
not sure what the reported values are supposed to be because they aren't aggregated values either.
Suppose I want to retrieve the export/import values for reporter-partner country pair i-j across k product codes, what exactly should I specify the ots_create_tidy_data() argument? Say, for example, reporter list c("usa", "can", "chl", "chn", "arg"), partners list c("usa", "can", "chl", "chn", "arg"), and product code c("0101", "0705"), such as
d <- ots_create_tidy_data(years = 2000, reporters = c("usa", "can", "chl", "chn", "arg"), partners = c("usa", "can", "chl", "chn", "arg"), products=c("0101", "0705"), table="yrc", max_attempts=5)
Also, when setting the "table" argument to "yrc", the output will not report partners' iso country code (as compared to when table is set to "yrp", yet this method will not report produce code). It will be a bit difficult to distinguish a reporter's export/import values of a particular product category to a particular "partner" from the output if I include a long list of partners in the function.
I am wondering if there's any way to get around this?
By all account, awesome and handy function!