View source: R/tes_tfc_functions.R
| calculate_fu_ex_sector | R Documentation | 
Calculate the total final consumption (TFC) at the final and useful stages
(along with any additional stages) by sector.
This function first uses the uses create_fd_sectors_list() function,
with a user-supplied set of final demand sectors fd_sectors
to identify the final demand sectors desired for analysis.
The Recca::finaldemand_aggregates() function is then applied to .sutdata
data frame by sector, to calculate the total final consumption of all products
in each of the sectors supplied in fd_sectors.
calculate_fu_ex_sector( .sutdata, fd_sectors, country_colname = IEATools::iea_cols$country, method_colname = IEATools::iea_cols$method, energy_type_colname = IEATools::iea_cols$energy_type, last_stage_colname = IEATools::iea_cols$last_stage, year_colname = IEATools::iea_cols$year, sector_colname = PFUWorkflow::sea_cols$sector_colname, fd_sectors_colname = PFUWorkflow::sea_cols$fd_sectors_colname, e_product_colname = PFUWorkflow::sea_cols$e_product_colname, stage_colname = PFUWorkflow::sea_cols$stage_colname, gross_net_colname = PFUWorkflow::sea_cols$gross_net_colname, agg_by_colname = PFUWorkflow::sea_cols$agg_by_colname, ex_colname = PFUWorkflow::sea_cols$ex_colname, ex_net_colname = PFUWorkflow::sea_cols$ex_net_colname, ex_gross_colname = PFUWorkflow::sea_cols$ex_gross_colname, net_value = PFUWorkflow::gross_net_metadata$net_value, gross_value = PFUWorkflow::gross_net_metadata$gross_value, all_value = PFUWorkflow::agg_metadata$all_value, sector_value = PFUWorkflow::agg_metadata$sector_value )
.sutdata | 
 A data frame containing Physical Supply-Use Table (PSUT) matrices with associated final demand sector names  | 
fd_sectors | 
 A character vector of final demand sectors.  | 
country_colname, method_colname, energy_type_colname, last_stage_colname, year_colname | 
 See   | 
sector_colname, fd_sectors_colname, e_product_colname, stage_colname, gross_net_colname, agg_by_colname, ex_colname, ex_net_colname, ex_gross_colname | 
 See   | 
net_value, gross_value | 
 See   | 
all_value, sector_value | 
 See   | 
A data frame containing total final and useful consumption by sector
library(Recca)
tfc_sector <- Recca::UKEnergy2000mats %>%
               tidyr::pivot_wider(names_from = matrix.name,
                                  values_from = matrix) %>%
               dplyr::mutate(Method = "PCM") %>%
               calculate_fu_ex_sector(fd_sectors = c("Residential"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.