shorten_multiple_column_names: Shorten Multiple Column Names

View source: R/CleanColumnNames.R

shorten_multiple_column_namesR Documentation

Shorten Multiple Column Names

Description

Used to abbreviate multiple column names based on their last values. Typical RHoMIS column names come in the for "xxxx/xxxxx/xxxxx/important_name". This function helps to extract only the final value "important name". It will do this for multiple column names

Usage

shorten_multiple_column_names(long_names, seperator)

Arguments

long_names

The list of column names which need to be shortened

seperator

The string seperating parts of each column name

Details

Rpackage file: CleanColumnNames.R

Value

A list of shortened column names

Examples


long_names <- c(
  "xxxx/xxxxx/xxxxx/important_name_1",
  "xxxx/xxxxx/xxxxx/important_name_2",
  "xxxx/xxxxx/xxxxx/important_name_3"
)
seperator <- "/"

shortened_names <- shorten_multiple_column_names(long_names, seperator)

l-gorman/rhomis-R-package documentation built on Nov. 8, 2023, 6:46 a.m.