View source: R/data_functions.R
is_balanced | R Documentation |
Performs the the energy balance check in a way that is amenable to drake subtargets.
Internally, this function uses IEATools::calc_tidy_iea_df_balances()
.
Grouping is doing internal to this function using the value of grp_vars
.
is_balanced( IEAData, countries, country = IEATools::iea_cols$country, grp_vars = c(country, IEATools::iea_cols$method, IEATools::iea_cols$energy_type, IEATools::iea_cols$last_stage, IEATools::iea_cols$year, IEATools::iea_cols$product) )
IEAData |
a tidy IEA data frame |
countries |
the countries for which balancing should be checked as strings |
country |
The name of the country column in |
grp_vars |
the groups that should be checked. Default is
|
a logical stating whether all products are balanced for the country of interest
# These data are not balanced, because they are raw. IEATools::sample_iea_data_path() %>% IEATools::load_tidy_iea_df() %>% is_balanced(countries = "ZAF")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.