View source: R/tes_tfc_functions.R
calculate_primary_ex_data | R Documentation |
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.
calculate_primary_ex_data(.sutdata, p_industry_prefixes)
.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". |
A data frame containing primary energy/exergy values aggregated by total, flow and product.
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")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.