calc_eta_pfd | R Documentation |
Calculates aggregate (total) primary-to-final demand (gross and net) efficiencies
across the energy conversion chain.
.aggregate_df
is probably formed by joining the results from
primary_aggregates()
and finaldemand_aggregates()
or by calling footprint_aggregates()
.
See examples.
calc_eta_pfd(
.aggregate_df = NULL,
efficiency_name_suffix = Recca::efficiency_cols$efficiency_name_suffix,
aggregate_primary_colname = Recca::aggregate_cols$aggregate_primary,
gross_aggregate_demand_colname = Recca::aggregate_cols$gross_aggregate_demand,
net_aggregate_demand_colname = Recca::aggregate_cols$net_aggregate_demand,
energy_type = Recca::psut_cols$energy_type,
last_stage = Recca::psut_cols$last_stage,
eta_pfd_gross = Recca::efficiency_cols$eta_pfd_gross,
eta_pfd_net = Recca::efficiency_cols$eta_pfd_net,
eta_pfd_gross_colname = paste0(eta_pfd_gross, efficiency_name_suffix),
eta_pfd_net_colname = paste0(eta_pfd_net, efficiency_name_suffix)
)
.aggregate_df |
A data frame or list containing columns
|
efficiency_name_suffix |
The suffix for efficiency names.
Default is |
aggregate_primary_colname |
The name of the column in |
gross_aggregate_demand_colname |
The name of the column in |
net_aggregate_demand_colname |
The name of the column in |
energy_type |
The name of the energy type column. Default is |
last_stage |
The name of the last stage column. Default is |
eta_pfd_gross |
The name of the output column containing efficiencies
of converting primary energy into gross final demand energy.
Default is |
eta_pfd_net |
The name of the output column containing efficiencies
of converting primary energy into net final demand energy.
Default is |
eta_pfd_gross_colname |
The name of the output column containing names of gross efficiency parameters.
Default is |
eta_pfd_net_colname |
The name of the output column containing names of net efficiency parameters.
Default is |
A data frame of aggregate efficiencies.
wide <- primary_total_aggregates_sut <- UKEnergy2000mats %>%
tidyr::pivot_wider(names_from = matrix.name, values_from = matrix)
# Define primary industries
p_industries <- c("Resources - Crude", "Resources - NG")
primary_total_aggregates <- wide %>%
Recca::primary_aggregates(p_industries = p_industries, by = "Total") %>%
# Don't need the matrices
dplyr::select(IEATools::iea_cols$country,
IEATools::iea_cols$year,
IEATools::iea_cols$energy_type,
IEATools::iea_cols$last_stage,
Recca::aggregate_cols$aggregate_primary)
# Define final demand sectors
fd_sectors <- c("Residential", "Transport", "Oil fields")
finaldemand_total_aggregates <- wide %>%
Recca::finaldemand_aggregates(fd_sectors = fd_sectors, by = "Total") %>%
# Don't need the matrices
dplyr::select(IEATools::iea_cols$country,
IEATools::iea_cols$year,
IEATools::iea_cols$energy_type,
IEATools::iea_cols$last_stage,
Recca::aggregate_cols$gross_aggregate_demand,
Recca::aggregate_cols$net_aggregate_demand)
dplyr::full_join(primary_total_aggregates,
finaldemand_total_aggregates,
by = c(IEATools::iea_cols$country,
IEATools::iea_cols$year,
IEATools::iea_cols$energy_type,
IEATools::iea_cols$last_stage)) %>%
calc_eta_pfd()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.