I would like to list the lines in an object so that lines that appear more than once are marked as "stringX1", "string2", etc.
This will be an example input:
strings <- c("stringQ", "stringW", "stringE", "stringQ")
Expected Result:
stringOut <- c("stringQ1", "stringW1", "stringE1", "stringQ2")
Note that "stringQ" exists twice, so I expect "stringQ1" and "stringQ2".
source
share