calculate_primary_ex_data: Create a data frame containing primary aggregate...

View source: R/tes_tfc_functions.R

calculate_primary_ex_dataR Documentation

Create a data frame containing primary aggregate energy/exergy data

Description

This functions creates a single data frame containing the total energy/exergy by country, year, method, energy quantification, and grouping variable (Total, Product, and Flow), for the Primary stage using the functions: calculate_p_ex_total, calculate_p_ex_flow, calculate_p_ex_product, and binding the outputs of these functions into a single data frame.

Usage

calculate_primary_ex_data(.sutdata, p_industry_prefixes)

Arguments

.sutdata

A data frame containing Physical Supply-Use Table (PSUT) matrices with associated final demand sector names

p_industry_prefixes

A character vector of primary energy industry prefixes. Usually "Resources", "Imports", and "Stock changes".

Value

A data frame containing primary energy/exergy values aggregated by total, flow and product.

Examples

library(Recca)
primary_data <- Recca::UKEnergy2000mats %>%
                  tidyr::pivot_wider(names_from = matrix.name,
                                     values_from = matrix) %>%
                  dplyr::mutate(Method = "PCM") %>%
                  calculate_primary_ex_data(p_industry_prefixes = list(c("Resources", "Imports")))


MatthewHeun/SEAPSUTWorkflow documentation built on April 22, 2022, 2:21 p.m.