powered by
This function pads the specified numbers with zeros to a specified total width.
prependZeros(x, width = max(nchar(x)))
Vector of numbers to be padded.
Width to pad the numbers to.
Character vector with the 0-padded numbers.
# NOT RUN { prependZeros(1:10) prependZeros(1:10, 4) # }
Run the code above in your browser using DataLab