io_gen_own_trade: Generate small own trade values as needed

View source: R/io_gen_own_trade.R

io_gen_own_tradeR Documentation

Generate small own trade values as needed

Description

Finds combinations of destination-sector-use in a standardized IO table that are 0 where destination == origin but different from 0 for at least one destination != origin and replaces them with either the smallest value found for one of the origin != destination cases or max_replace, whichever is smaller.

Usage

io_gen_own_trade(iot, max_replace)

Arguments

iot

a tibble with a standardized input output table in long format with the columns origin, sector, destination, use, flow. See the package iotr for more details on this format.

max_replace

maximum value to replace zero own trade flows with.

Value

Returns the data frame iot with respective zero own trade flows removed.

References

This manipulation of the original IO table is useful for specific simulations that feature infinite trade barrieres. See for example Eppinger, Peter and Felbermayr, Gabriel J. and Krebs, Oliver and Kukharskyy, Bohdan, COVID-19 Shocking Global Value Chains (2020). CESifo Working Paper No. 8572, https://ssrn.com/abstract=3702124


okrebs/iotr documentation built on Aug. 22, 2023, 12:06 p.m.