createIdAlong: Create Unique Identifiers along Input Vector

View source: R/string.R

createIdAlongR Documentation

Create Unique Identifiers along Input Vector

Description

This function helps you create strings that can be used as identifiers.

Usage

createIdAlong(x, base_name = NULL)

Arguments

x

vector of objects for which to create identifiers

base_name

base string to which the hexadecimal suffixes are to be appended. By default the name of the object x, with "s" at the end removed, is used. For example, passing a vector called "files" to this function results in ids "file_01", "file_02", ...

Value

vector of character as long as x

Examples

# Create ids for 32 numbers
createIdAlong(1:32, "number")
# Take base name from x, with the plural's "s" removed
numbers <- 1:32
createIdAlong(numbers)

KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.