reverse: Reverse an energy conversion chain

View source: R/utilities.R

reverseR Documentation

Reverse an energy conversion chain

Description

Leontief's original input-output analysis involved swimming "upstream" to estimate the economy that would be needed if different final demand were observed. But what if different resources were available? The analysis is the same if resources become final demand (and vice versa) and make becomes use (and vice versa). That is, the analysis is the same if you're dealing with a reversed energy conversion chain (ECC). This function performs that reversal.

Usage

reverse(
  .sutmats = NULL,
  R = Recca::psut_cols$R,
  U = Recca::psut_cols$U,
  V = Recca::psut_cols$V,
  Y = Recca::psut_cols$Y,
  R_rev = paste0(Recca::psut_cols$R, "_rev"),
  U_rev = paste0(Recca::psut_cols$U, "_rev"),
  V_rev = paste0(Recca::psut_cols$V, "_rev"),
  Y_rev = paste0(Recca::psut_cols$Y, "_rev")
)

Arguments

.sutmats

the input ECC

R

The R matrix in the ECC to be reversed. (Default is "R".)

U

The U matrix in the ECC to be reversed. (Default is "U".)

V

The V matrix in the ECC to be reversed. (Default is "V".)

Y

The Y matrix in the ECC to be reversed. (Default is "Y".)

R_rev

The name of the R matrix in the reversed ECC. (Default is "R_rev".)

U_rev

The name of the U matrix in the reversed ECC. (Default is "U_rev".)

V_rev

The name of the V matrix in the reversed ECC. (Default is "V_rev".)

Y_rev

The name of the Y matrix in the reversed ECC. (Default is "Y_rev".)

Details

To reverse an ECC, the R, U, V, and Y matrices need to be transposed and swapped: R with Y and U with V. This function performs those operations.

Value

A reversed version of the ECC described by R, U, V, and Y.

Examples

library(dplyr)
library(Recca)
library(tidyr)
mats <- UKEnergy2000mats %>%
  spread(key = "matrix.name", value = "matrix") %>%
  reverse()
mats$R_rev[[1]]
mats$U_rev[[1]]
mats$V_rev[[1]]
mats$Y_rev[[1]]

MatthewHeun/Recca documentation built on Feb. 9, 2024, 6:18 p.m.