The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

makeunique

Lifecycle: experimental CRAN status R-CMD-check Codecov test coverage

R package for making all elements of a vector unique. Differs from ‘make.unique’ by starting at 1 and allowing users to customise suffix format.

Installation

Install from cran

install.packages('makeunique')

Install the development version of from github:

# install.packages('remotes')
remotes::install_github('selkamand/makeunique')

Usage

library(makeunique)

make_unique(c('Bob', 'Bob', 'Bob', 'Billy', 'Billy', 'Sven'))
#> [1] "Bob (1)"   "Bob (2)"   "Bob (3)"   "Billy (1)" "Billy (2)" "Sven"

make_unique(c('Bob', 'Bob', 'Bob', 'Billy', 'Billy', 'Sven'), sep = '-', wrap_in_brackets = FALSE)
#> [1] "Bob-1"   "Bob-2"   "Bob-3"   "Billy-1" "Billy-2" "Sven"

Acknowledgements

Inspired heavily by the answers in the following thread

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.