Skip to contents

A simple wrapper function to assist with removing unneeded columns from the PSUTUsefulIEAWithDetails target.

Usage

remove_cols_from_PSUTUsefulIEAWithDetails(
  psut_useful_iea_with_details,
  cols_to_remove,
  phi_vecs,
  remove_final = FALSE,
  countries,
  country = IEATools::iea_cols$country,
  year = IEATools::iea_cols$year,
  last_stage = IEATools::iea_cols$last_stage,
  final = IEATools::all_stages$final
)

Arguments

psut_useful_iea_with_details

The target from which columns should be removed.

cols_to_remove

A string vector of columns names to be removed.

phi_vecs

The name of the phi vector column in psut_useful_iea_with_details.

remove_final

A boolean that tells whether to remove Last.stage == "Final" rows. Default is FALSE.

countries

The countries for which this function should be applied.

country

The name of the Country column in psut_useful_iea_with_details and phi_vecs. Default is IEATools::iea_cols$country.

year

The name of the Year column in psut_useful_iea_with_details and phi_vecs. Default is IEATools::iea_cols$year.

last_stage

The name of the "Last.stage" column. Default is IEATools::iea_cols$last_stage.

final

The string defining the final stage. Default is IEATools::all_stages$final.

Value

A version of psut_useful_iea_with_details with cols_to_remove removed.

Details

This function enables mapping over countries.