tidy_iea_df | R Documentation |
Data from the IEA have years in columns,
but the tidy data format
requires one row for each datum.
This function uses tidyr::pivot_longer()
to
make an IEA data frame tidy.
tidy_iea_df(
.iea_df,
col_names = IEATools::iea_cols,
year = col_names$year,
e_dot = col_names$e_dot,
method = col_names$method,
last_stage = col_names$last_stage,
country = col_names$country,
ledger_side = col_names$ledger_side,
flow_aggregation_point = col_names$flow_aggregation_point,
energy_type = col_names$energy_type,
unit = col_names$unit,
flow = col_names$flow,
product = col_names$product,
remove_zeroes = TRUE
)
.iea_df |
A IEA data frame whose columns have been renamed by |
col_names |
A list of column names in IEA data frames.
Default is |
year |
The name of the year column created in |
e_dot |
The name of the energy/exergy value column created in |
method |
The name of the method column created in |
last_stage |
The name of the last stage column created in |
country |
The name of the country column in |
ledger_side |
The name of the ledger side in |
flow_aggregation_point |
The name of the flow aggregation point column in |
energy_type |
The name of the energy type column in |
unit |
The name of the unit column in |
flow |
The name of the flow column in |
product |
The name of the product column in |
remove_zeroes |
A logical indicating whether data points with the value |
Default argument values assume that rename_iea_df_cols()
has been called on .iea_df
.
A tidy version of .iea_df
containing new columns year
and e_dot
and, optionally, 0
values removed.
sample_iea_data_path() %>%
iea_df() %>%
rename_iea_df_cols() %>%
remove_agg_memo_flows() %>%
use_iso_countries() %>%
augment_iea_df() %>%
tidy_iea_df()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.