remove_neu | R Documentation |
Frequently, Non-energy use should be removed from an energy conversion chain,
in final demand, at the useful stage, at the final stage, and at the primary stage.
This function removes Non-energy use via an "upstream swim" with new_Y()
.
remove_neu(
.sutmats,
neu_product_pattern = RCLabels::make_or_pattern(c("NEU", nonenergy_products)),
neu_industry_pattern = RCLabels::make_or_pattern("Non-energy use", pattern_type =
"leading"),
method = "solve",
R = Recca::psut_cols$R,
U = Recca::psut_cols$U,
U_feed = Recca::psut_cols$U_feed,
U_eiou = Recca::psut_cols$U_eiou,
r_eiou = Recca::psut_cols$r_eiou,
V = Recca::psut_cols$V,
Y = Recca::psut_cols$Y,
S_units = Recca::psut_cols$S_units,
prime_suffix = "_prime",
R_prime = paste0(Recca::psut_cols$R, prime_suffix),
U_prime = paste0(Recca::psut_cols$U, prime_suffix),
U_feed_prime = paste0(Recca::psut_cols$U_feed, prime_suffix),
U_eiou_prime = paste0(Recca::psut_cols$U_eiou, prime_suffix),
r_eiou_prime = paste0(Recca::psut_cols$r_eiou, prime_suffix),
V_prime = paste0(Recca::psut_cols$V, prime_suffix),
Y_prime = paste0(Recca::psut_cols$Y, prime_suffix),
S_units_prime = paste0(Recca::psut_cols$S_units, prime_suffix)
)
.sutmats |
A data frame or named list of PSUT matrices. |
neu_product_pattern |
A string regex pattern that identifies Non-energy use rows
in the final demand (Y) matrix.
Default is |
neu_industry_pattern |
A string regex pattern that identifies Non-energy use columns
in the final demand (Y) matrix.
Default is |
method |
The method by which upstream swim will be conducted.
Default is "solve" for the usual |
R , U , U_feed , U_eiou , r_eiou , V , Y , S_units |
String names for matrix columns or list items in |
prime_suffix |
The suffix for names of modified matrices. Default is "_prime". |
R_prime , U_prime , U_feed_prime , U_eiou_prime , r_eiou_prime , V_prime , Y_prime , S_units_prime |
Output names. Defaults are formed by appending "_prime" to default names. |
Although this function is remove_neu()
,
it can be used to remove any row or column from the final demand matrix
and calculate the remaining ECC
by overriding the default value for the neu_industry_pattern
or neu_product_pattern
arguments.
Note that if a data frame or a list is passed in .sutmats
,
the original matrices will remain as columns, and
new columns will be added with *_prime
matrices.
Callers may wish to delete the original matrices
in the returned data frame.
A version of the energy conversion chain with Non-energy use industries and products removed.
UKEnergy2000mats |>
tidyr::spread(key = matrix.name, value = matrix) |>
dplyr::filter(LastStage != "Services") |>
# This data frame does not contain "Non-energy use",
# so remove "Residential" instead.
Recca::remove_neu(neu_product_pattern = "^NG|^MD",
neu_industry_pattern = "^Residential")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.