rename_duplicates: Make a list of strings unique

Description Usage Arguments Value Examples

View source: R/utility_functions.R

Description

It might happen that there are duplicated strings in a list. With this function we will rename those duplicated entries in a way that we simply add the number of occurrences to the string. I.e., when the string foo occurs three times in a list, it will be renamed to foo_1, foo_2, and foo_3, respectively.

Usage

1

Arguments

names

List of strings where duplicates should be renamed

Value

List where duplicates are renamed.

Examples

1
2
l <- c( "foo", "bar", "foo", "bars")
rename_duplicates( l)

multiGSEA documentation built on Nov. 8, 2020, 8:15 p.m.