grepRename: grepRename

View source: R/B002_grepRename.R

grepRenameR Documentation

grepRename

Description

A function to rename the names in a named list using grep patterns.

Usage

grepRename(inputList, inputPattern, replaceString)

Arguments

inputList

a named list

inputPattern

the items to be renamed

replaceString

the replacement

Value

Returns the original list with any matches renamed.

Examples

testInputList=list(col="red",.colour="blue",points_.colour="green",lines_col="yellow",lines_.colour="pink")
testOutputList=grepRename(testInputList,"\\.colour$","col")
expectedOutputList=list(col="blue",points_col="green",lines_col="pink")

R-graphic-design/RGD documentation built on Jan. 2, 2023, 10:30 p.m.