Skip to contents

Shorten a variable name

Usage

NameCleanUp(name, removestrings, substitutestrings)

Arguments

name

The variable that you wish to shorten.

removestrings

A list of strings to be sequentially removed from the name. An example: removestrings = c("ReferenceGroup_", ".fcs")

substitutestrings

A data.frame containing two columns, Original and Substitute. When a row of Original is recognized, it's replaced with substitute value.

Value

The shortened variable

Examples

name <- "DR BUV496 CD8 (Cells).fcs"
removestrings <- c("DR", "(Cells)", ".fcs", " ")
Cleaned_Name <- NameCleanUp(name, removestrings)