rename.duplicate: Function to rename duplicated strings

rename.duplicateR Documentation

Function to rename duplicated strings

Description

This function renames duplicated strings by adding their number of occurrences at the end.

Usage

rename.duplicate(x, sep = "_", verbose = FALSE)

Arguments

x

vector of strings.

sep

a character to be the separator between the number added at the end and the string itself.

verbose

TRUE to print informative messages, FALSE otherwise.

Value

A list with items:

  • new.x: new strings (without duplicates).

  • duplicated.x: strings which were originally duplicated.

Examples

nn <- sample(letters[1:10], 30, replace=TRUE)
table(nn)
rename.duplicate(x=nn, verbose=TRUE)


bhklab/genefu documentation built on June 2, 2022, 2:56 p.m.