A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/selkamand/makeunique below:

selkamand/makeunique: Make Character Vectors Unique

makeunique

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.

Install from cran

install.packages('makeunique')

Install the development version of from github:

# install.packages('remotes')
remotes::install_github('selkamand/makeunique')
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"

Inspired heavily by the answers in the following thread


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4