add left padding to a vector of values
pad_left(.x, .n, padding_char = "0")
Arguments
.x |
vector |
.n |
total number of characters result should have |
padding_char |
padding char to use, defaults to 0 |
Examples
pad_left(1, 3)
#> [1] "001"
pad_left(c(1, 10, 100), 4)
#> [1] "0001" "0010" "0100"