wrapper around mutate and str_pad
pad_col(mdb, ..., width, pad = "0", side = "left")
Arguments
- mdb
data frame
- ...
tidyselect
- width
str_pad width
- pad
str_pad pad
- side
str_pad side
Examples
# manually pad with 0's (or other value)
# use case over [pad_auto()]: the desired width is greater than the widest element
tibble::tibble(
ID = c(2, 13, 86, 302)
) %>%
pad_col(ID, width = 4)
#> # A tibble: 4 × 1
#> ID
#> <chr>
#> 1 0002
#> 2 0013
#> 3 0086
#> 4 0302