Skip to contents

Builds identifiers such as BoE000123 from numbers, with a fixed width so that they sort in order.

Usage

pad_id(x, prefix = "", width = 6L)

Arguments

x

Numbers (or strings of digits).

prefix

Character. Prefix pasted before the number.

width

Integer. Number of digits.

Value

A character vector.

See also

Other identifiers: hash_id(), make_doc_id(), make_slug()

Examples

pad_id(c(1, 23, 456), prefix = "BoE")
#> [1] "BoE000001" "BoE000023" "BoE000456"