io_rm_negative_vad: Remove Negative VAD from IO Table

View source: R/io_rm_negative_vad.R

io_rm_negative_vadR Documentation

Remove Negative VAD from IO Table

Description

Remove negative imputed value added (VAD) from an input-output (IO) table by scaling the total output and world wide use of the specific location-sector.

Usage

io_rm_negative_vad(iot, category_to_scale)

Arguments

iot

An input-output table in long format with the columns, origin, sector, destination, use and flow

category_to_scale

the use category (as integer) which to scale if output has to be increased due to an imputed negative VAD

Details

In location-sectors where a given IO table reports intermediate use larger than output value, i.e. where imputed VAD would be negative, this function increases output until the imputed VAD matches the smallest share of VAD in output found in any other location-sector in the IO table. To account for the destination of the additional production the use category category_to_scale is increased around the world to match the increased production. If no negative value added is imputed the IO table is returned unchanged.

Value

Returns an IO table in long format as a tibble with the columns origin, sector, destination, use and flow

Examples

## Not run: 

library(iotr)

# set cache_dir for WIOD to avoid long download times on every run !!!
cache_dir <- NULL

wiot_raw <- io_load_wiot(cache_dir, years = 2000:2014)

wiot_long <- io_tidy_wiot(wiot_raw)

# get wiot into standard long IO-table format
iot <- dplyr::filter(wiot_long, Country != "TOT", Year == "2014")
iot <-
  dplyr::select(iot,
                origin = Country,
                sector = RNr,
                destination,
                use,
                flow)

iot <- io_rm_negative_vad(iot, category_to_scale = 57)

iot <-
  io_rm_dynamics(iot,
                 dynamic_categories = c(60, 61),
                 category_to_scale = 57)

iot <- io_gen_own_trade(iot, max_replace = 1e-6)


## End(Not run)

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