View source: R/energy_balance.R
verify_SUT_energy_balance_with_units | R Documentation |
If energy is in balance for every row, .sutmats
is returned with two additional columns, and
execution returns to the caller.
If energy balance is not observed for one or more rows,
a warning is emitted, and
columns named SUT_prod_energy_blance
and SUT_ind_energy_blance
are added to .sutmats
.
FALSE
indicates energy is not in balance.
verify_SUT_energy_balance_with_units(
.sutmats = NULL,
R = "R",
U = "U",
U_feed = "U_feed",
U_eiou = "U_EIOU",
r_eiou = "r_EIOU",
V = "V",
Y = "Y",
S_units = "S_units",
tol = 1e-06,
matnames = "matnames",
matvals = "matvals",
rowtypes = "rowtypes",
coltypes = "coltypes",
rownames = "rownames",
colnames = "colnames",
prod_diff = ".prod_diff",
ind_diff = ".ind_diff",
SUT_prod_energy_balanced = ".SUT_prod_energy_balanced",
SUT_ind_energy_balanced = ".SUT_ind_energy_balanced",
ebal_error = "ebal_error",
product = "Product"
)
.sutmats |
An SUT-style data frame containing columns
|
R |
Resource ( |
U |
Use ( |
U_feed , U_eiou , r_eiou |
Optional matrices or columns in |
V |
Make ( |
Y |
Final demand ( |
S_units |
|
tol |
The maximum amount by which energy can be out of balance. Default is |
matnames , matvals , rowtypes , coltypes , rownames , colnames |
Column names used internally. |
prod_diff , ind_diff , ebal_error , product |
Column names for product and industry energy balance errors. |
SUT_prod_energy_balanced |
The name for booleans telling if product energy is in balance. Default is ".SUT_prod_energy_balance". |
SUT_ind_energy_balanced |
The name for booleans telling if product energy is in balance. Default is ".SUT_inds_energy_balance". |
This function should be called
for its side-effect of testing whether energy is in balance in .sutmats
.
Both product and industry energy balance are verified.
Units (as supplied by the S_units
matrix) are respected.
.sutmats
with additional columns.
library(tidyr)
verify_SUT_energy_balance_with_units(UKEnergy2000mats %>%
tidyr::spread(key = matrix.name, value = matrix),
tol = 1e-3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.