View source: R/treatTxtDuplicates.R
treatTxtDuplicates | R Documentation |
treatTxtDuplicates
locates duplictes in character-vector 'x' and return list (length=3) : with $init (initial),
$nRed .. non-redundant text by adding number at end or beginning, and $nrLst .. list-version with indexes per unique entry.
Note : NAs (if multiple) will be renamed to NA_1, NA_2
treatTxtDuplicates(
x,
atEnd = TRUE,
sep = "_",
onlyCorrectToUnique = FALSE,
silent = FALSE,
debug = FALSE,
callFrom = NULL
)
x |
(character) vector with character-entries to identify (and remove) duplicates |
atEnd |
(logical) decide location of placing the counter (at end or at beginning of ID) (see |
sep |
(character) separator to add before counter when making non-redundant version |
onlyCorrectToUnique |
(logical) if TRUE, return only vector of non-redundant |
silent |
(logical) suppress messages |
debug |
(logical) additional messages for debugging |
callFrom |
(character) allow easier tracking of messages produced |
list with $init, $nRed, $nrLst
For simple correction use correctToUnique
treatTxtDuplicates(c("li0",NA,rep(c("li2","li3"),2)))
correctToUnique(c("li0",NA,rep(c("li2","li3"),2)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.