rename_iea_df_cols: Rename columns of an IEA data frame

View source: R/initialize.R

rename_iea_df_colsR Documentation

Rename columns of an IEA data frame

Description

The IEA data has columns named COUNTRY, FLOW, and PRODUCT. This function turns off the shouting, renaming the columns (by default) to Country, Flow, and Product.

Usage

rename_iea_df_cols(
  .iea_df,
  country = "COUNTRY",
  new_country = IEATools::iea_cols$country,
  flow = "FLOW",
  new_flow = IEATools::iea_cols$flow,
  product = "PRODUCT",
  new_product = IEATools::iea_cols$product
)

Arguments

.iea_df

a data frame produced by iea_df()

country

the original name for the country column. (Default is COUNTRY.)

new_country

the new name for the country column. (Default is IEATools::iea_cols$country.)

flow

the original name for the flow column. (Default is FLOW.)

new_flow

the new name for the flow column. (Default is IEATools::iea_cols$flow.)

product

the original name for the product column. (Default is PRODUCT.)

new_product

the new name for the product column. (Default is IEATools::iea_cols$product.)

Value

.iea_df with renamed columns

Examples

iea_df(text = ",,TIME,1960,1961\nCOUNTRY,FLOW,PRODUCT\nWorld,Production,Hard coal,42,43") %>% 
  rename_iea_df_cols()

MatthewHeun/IEATools documentation built on Feb. 6, 2024, 3:29 p.m.