Skip to contents

Occasionally, in the IEA extended energy balance data, extra whitespace characters are found at the beginning or end of Flow and Product strings. This function removes all leading and trailing whitespece.

Usage

clean_iea_whitespace(
  .iea_df,
  flow = IEATools::iea_cols$flow,
  product = IEATools::iea_cols$product
)

Arguments

.iea_df

A data frame containing Flow and Product columns.

flow

The name of the flow column in iea_df. Default is "Flow".

product

The name of the product columns in iea_df. Default is "Product".

Value

.iea_df with leading and trailing whitespace removed from Flow and Product column strings

Examples

data.frame(Flow = "  a flow   ", Product = "   a product   ", stringsAsFactors = FALSE) %>% 
  clean_iea_whitespace()
#>     Flow   Product
#> 1 a flow a product