View source: R/io_rm_negative_vad.R
io_rm_negative_vad | R Documentation |
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.
io_rm_negative_vad(iot, category_to_scale)
iot |
An input-output table in long format with the columns,
|
category_to_scale |
the use category (as integer) which to scale if output has to be increased due to an imputed negative VAD |
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.
Returns an IO table in long format as a tibble
with the
columns origin
, sector
, destination
, use
and
flow
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.