make_id {faux} | R 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)
[Package faux version 1.2.1 Index]