add_suffix: Add a suffix when strings are identical

View source: R/internal.R

add_suffixR Documentation

Add a suffix when strings are identical

Description

An integer will be added as suffix in x if an identical value is in y. If a value with suffix is already in y, the function will search for the highest suffix to avoid duplicated values.

Usage

add_suffix(x, y, sep = "_")

Arguments

x

(character of length 1) The name to be compared.

y

(character) Existing names, with or without suffixes.

sep

(character of length 1) Symbol to be placed between the original name and the suffix.

Value

A character value, either x or x with suffix if already in y.


kamapu/taxlist documentation built on Feb. 17, 2024, 8:27 a.m.