make_id: Make ID

View source: R/make_id.R

make_idR Documentation

Make ID

Description

Make IDs with fixed length and a prefix (e.g., S001, S002, ..., S100).

Usage

make_id(n = 100, prefix = "S", digits = 0, suffix = "")

Arguments

n

the number of IDs to generate (or a vector of numbers)

prefix

the prefix to the number (default "S")

digits

the number of digits to use for the numeric part. Only used if this is larger than the largest number of digits in n.

suffix

the suffix to the number (default "")

Value

a vector of IDs

Examples


make_id(20, "SUBJECT_")
make_id(10:30, digits = 3)


faux documentation built on April 20, 2023, 9:13 a.m.