Create a data frame containing primary aggregate energy/exergy data
calculate_primary_ex_data.Rd
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.
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".
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")))