clean_iea_whitespace: Clean whitespace from Flow and Product strings

View source: R/initialize.R

clean_iea_whitespaceR Documentation

Clean whitespace from Flow and Product strings

Description

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()

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