Hi,
Use str_pad() function to format the length of field values (string type).
Syntax: str_pad(string,width, side = "left/right")
To use str_pad(), convert the numeric field to string and then back to numeric after padding.
Ex:
> c = c("1","10","3","4","50")
> c
[1] "1" "10" "3" "4" "50"
> str_pad(c,2,side = "right",pad = "0")
[1] "10" "10" "30" "40" "50"