Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

correctToUnique

Correct vector to unique


Description

correctToUnique checks 'x' for unique entries, while maintaining the original length. If necessary a counter will added to non-unique entries.

Usage

correctToUnique(
  x,
  sep = "_",
  atEnd = TRUE,
  maxIter = 4,
  NAenum = TRUE,
  callFrom = NULL
)

Arguments

x

input character vector

sep

(character) separator used when adding counter

atEnd

(logical) decide location of placing the counter (at end or at beginning of initial text)

maxIter

(numeric) max number of iterations

NAenum

(logical) if TRUE all NAs will be enumerated (NA_1,NA_2,...)

callFrom

(character) for better tracking of use of functions

Value

character vector

See Also

unique will simply remove repeated elements, ie length of 'x' won't remain constant, filtSizeUniq is more complex and slower, treatTxtDuplicates

Examples

correctToUnique(c("li0","n",NA,NA,rep(c("li2","li3"),2),rep("n",4)))

wrMisc

Analyze Experimental High-Throughput (Omics) Data

v1.5.4
GPL-3
Authors
Wolfgang Raffelsberger [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.