build CRAN_Status_Badge lifecycle License: Mit Github commit

zerotradeflow is a system for creating the bilateral trade flow between a country pair equal to zero. You provide the data, tell zerotradeflow which variables are of interest and it expands the base by creating the bilateral zero trade flow. The bases on the flow of trade between countries only report positive trade (greater than zero), however, for some analyzes of gravitacional models, data on zero flow is also necessary.


To install the package, one of the two standard methods for installing packages in R can be adopted. Directly through the cran (choosing the closest repository):

install.packages ("zerotradeflow")

Or the development version from GitHub:

# install.packages ("devtools")
devtools::install_github ("AlexandreLoures/zerotradeflow")

In the latter case, the latest version of the package will be installed.


The operation of the zerotradeflow package consists of informing where the data are (the base) to be expanded and indicating the variables: year, exporting country, importing country, Harmonized Commodity Designation and Coding System (or other classification) and value of exports/imports. It takes into account that the order must be obeyed: data, year, exporter, importer, designation and coding and flow value.

An application for Gravitational Models of Trade


Figueiredo and Loures (2016) O efeito do Mercosul sobre a comercializaĆ§Ć£o de novos produtos.