View source: R/energy_balance.R
verify_SUT_energy_balance | R Documentation |
Energy balances are confirmed by Product (within tol
) for every row in .sutmats
.
verify_SUT_energy_balance(
.sutmats = NULL,
R = "R",
U = "U",
V = "V",
Y = "Y",
tol = 1e-06,
SUT_energy_balance = ".SUT_energy_balance"
)
.sutmats |
an SUT-style data frame with columns of matrices,
including |
R |
resources ( |
U |
use ( |
V |
make ( |
Y |
final demand ( |
tol |
the maximum amount by which Supply and Consumption can be out of balance.
Default is |
SUT_energy_balance |
the name for booleans telling if energy is in balance. Default is ".SUT_energy_balance". |
If energy is in balance for every row, .sutmats
is returned with an additional column, and
execution returns to the caller.
If energy balance is not observed for one or more of the rows,
a warning is emitted, and
the additional column (SUT_energy_blance
)
indicates where the problem occurred, with FALSE
showing where energy is not in balance.
a list or data frame saying whether .sutmats
are in balance.
library(dplyr)
library(tidyr)
verify_SUT_energy_balance(UKEnergy2000mats %>%
dplyr::filter(LastStage %in% c("Final", "Useful")) %>%
tidyr::spread(key = matrix.name, value = matrix),
tol = 1e-4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.