check_balance: Checks the mass balance of the flows involved

Description Usage Arguments Value Examples

View source: R/checks.R

Description

For each substance involved, the balance per (internal) node is inspected. If outflow exceed inflow, or vice versa, a message is printed, and the function returns FALSE.

Usage

1
check_balance(nodes, flows, tolerance = 0.01)

Arguments

nodes

data.frame containing the nodes definition

flows

data.frame containing the flows definition

tolerance

numeric specifying a tolerance. Default is 0.01 (1%)

Value

TRUE if balanced, FALSE if not.

Examples

1
2
3
nodes <- data.frame(ID=c("A","B","C"), x=1:3, y=1:3, dir=c("right","right","stock"))
flows <- data.frame(from=c("A","B"), to=c("B","C"), quantity=c(10,10))
check_balance(nodes,flows)

PantaRhei documentation built on Dec. 18, 2020, 5:08 p.m.