powered by
correctToUnique checks 'x' for unique entries, while maintaining the original length. If necessary a counter will added to non-unique entries.
correctToUnique
correctToUnique( x, sep = "_", atEnd = TRUE, maxIter = 4, NAenum = TRUE, silent = FALSE, callFrom = NULL )
This function returns a character vector
input character vector
(character) separator used when adding counter
(logical) decide location of placing the counter (at end or at beginning of initial text)
(numeric) max number of iterations
(logical) if TRUE all NAs will be enumerated (NA_1,NA_2,...)
TRUE
NA
(logical) suppress messages
(character) for better tracking of use of functions
unique will simply remove repeated elements, ie length of 'x' won't remain constant, filtSizeUniq is more complex and slower, treatTxtDuplicates
unique
filtSizeUniq
treatTxtDuplicates
correctToUnique(c("li0","n",NA,NA,rep(c("li2","li3"),2),rep("n",4)))
Run the code above in your browser using DataLab