make_custom_wio: Make standard world input-output matrices from custom data

View source: R/make_custom_wio.R

make_custom_wioR Documentation

Make standard world input-output matrices from custom data

Description

Creates a list object of class wio containing the typical international input-output matrices in a standardized format, as well as a list of code names (countries, sectors and demand components) and a list of dimensions (number of countries, sectors and demand components), using custom data.

Usage

make_custom_wio(
  df,
  g_names,
  n_names = NULL,
  fd_names = NULL,
  year = NULL,
  quiet = FALSE
)

Arguments

df

A data frame or matrix containing data for intermediate inputs and final demand.

g_names

A string vector with names of countries.

n_names

A string vector with names of sectors. If missing, sectors will be S01, S02, etc. If just one sector, it will be named TOTAL.

fd_names

A string vector with names of final demand components. If missing, demand components will be FD1, FD2, etc. If just one, it will be named FD.

year

Integer. If missing, the current year will be used.

quiet

Boolean, if TRUE, the function will produce a silent output.

Details

make_custom_wio() creates a wio from custom input-output data provided as a single matrix of dimension ⁠GxN x GxFD⁠, i.e., the matrix Z of intermediate inputs (dimension ⁠GxN x GxN⁠) bound with the matrix Yfd of final demand (dimension ⁠GxN x GxFD⁠). The matrices of total output X and value added VA will be automatically generated, so should not be included. Data must be exclusively numeric.

A string vector with the names of countries is required. Number of countries will be calculated from this vector. Names for sectors and final demand components can be provided or will otherwise be automatically generated. All names must be composed of alphabetic characters (no special characters are allowed).

Value

A wioobject of wiotype = "custom".

Examples

df <- as.data.frame(matrix(c(19:36), nrow = 3))
wio <- make_custom_wio(df, g_names = c("C01", "C02", "C03"))

exvatools documentation built on Sept. 17, 2024, 1:07 a.m.