Loads disaggregated data on bilateral trade flows for more than 5000 products and 200 countries. The data is from the CEPII and is built from data directly reported by each country to the United Nations Statistical Division (Comtrade).

As all of the data is packed into one single .zip file in the website, data on all years must be downloaded, even if not all of it is used. Therefore, downloading the data can take a long time.


  1. dataset: there is one choice:

  2. raw_data: there are two options:

  3. time_period: picks the years for which the data will be downloaded

  4. language: you can choose between Portuguese ("pt") and English ("eng")


# download treated data for 2016 (takes a long time to download)
clean_baci <- load_baci(
  raw_data = FALSE,
  time_period = 2016