Skip to contents

This function provides a handy way to tell if all rows of .tidy_iea_df_balance are in balance. Argument .tidy_iea_df_balances should be set to the value of a call to calc_tidy_iea_df_balances().

Usage

tidy_iea_df_balanced(.tidy_iea_df_balances, balance_OK = "balance_OK")

Arguments

.tidy_iea_df_balances

an IEA-style data frame containing a column that indicates whether each row is in balance.

balance_OK

the name of a new logical column that tells whether a row's energy balance is OK. Default is "balance_OK".

Value

TRUE if all groups of .tidy_iea_df_balances are balanced, FALSE otherwise.

Examples

library(dplyr)
load_tidy_iea_df() %>% 
  calc_tidy_iea_df_balances() %>% 
  tidy_iea_df_balanced()
#> [1] FALSE