The format_aid function formats (numeric) AID IDs into character strings of a predefined length (parameter length) adding leading "0"s to the provided ID (x).

format_aid(x, length = 10)

Arguments

x

numeric with the IDs to format.

length

integer(1) defining the length (in characters) of the AID format.

Value

character with the formated AID.

Author

Johannes Rainer

Examples


format_aid(c(1, 2, 3))
#> [1] "0000000001" "0000000002" "0000000003"

## IDs provided as `character` are not formatted.
format_aid("hello")
#> [1] "hello"