library(knitr)
opts_knit$set(root.dir="../..") # file paths are relative to the root of the project directory
# opts_chunk$set(echo=FALSE)
library(tradeflows)
library(dplyr)

Load the ITTO product table and rename columns

ITTO uses internal product names. The classification is different to what was used in comtrade. HS07 in this ITTO table probably corresponds to HS3 in comtrade that is why we let it called nomenclature for the moment.

Description is called product in the efi convention for column names, this might have to be changed.

itto <- read.csv("data-raw/ITTO_products.csv", as.is=TRUE)
str(itto)
itto <- itto %>%
    select(product = Names.of.products, 
           productcodeitto = Product.code, 
           nomenclature = Nomenclature,
           productcodecomtrade = Code,
           description = Description) 

List ITTO product codes and names

itto %>% 
    select(product, productcodeitto) %>%
    unique() %>%
    kable()

Compare ITTO code and names to those of Comtrade

Product list to download in priority in the most recent classification

Products used for the analysis in a prototype system.

itto %>% 
    filter(nomenclature == "HS12",
           product %in% c("SAWNWOOD", "LOGS", "VENEER", 
                          "CONIFEROUS FURTHER PROCESSED SAWNOOD", 
                          "NON-CONIFEROUS FURTHER PROCESSED SAWNOOD",
                          "WOODEN FURNITURE",
                          "WOOD CHARCOAL")) %>%
#     write.csv(file="data-raw/listofproductstodownload.csv", row.names=FALSE)
    kable

Example products under ITTO SAWNWOOD

swd <- itto %>% 
    filter(product == "SAWNWOOD")
kable(swd)

Example products under Comtrade 4407

4407 is an aggregate of sawnwood products and doesn't appear in the ITTO table

itto %>%
    filter(productcodecomtrade == 4407) 

Example products under Comtrade 440792

For ITTO, 440792 is a sub product of sawnwood.

itto %>%
    filter(productcodecomtrade == 440792) %>%
    kable()

Example products under Comtrade 440799

itto %>%
    filter(productcodecomtrade == 440799) %>%
    kable()

Load the ITTO reporter table and rename columns




EuropeanForestInstitute/tradeflows documentation built on Oct. 7, 2019, 10:57 a.m.