Pad a vector of numbers with zeros
Pad a numeric vector with zeros so that each element in the vector either has 1) the same number of characters or 2) the same number of trailing decimal places.
The numeric vector to be padded
The maximum number of zeros that will be added. If
The side to which the zeros are added.
side = 'left',
num is the number of characters that each
element of the padded, output vector should have. If
num = NULL, the
largest number of characters that appears in the vector is chosen for
side = 'right',
num is the number of decimal places to be
num = NULL, the number of decimals in the element with
the largest number of decimal places is used.
vec must be numeric when
side = 'right'. However,
vec may be character when
side = 'left'.
Character vector with the leading (or trailing) elements padded with zeros.
1 2 3 4 5 6 7
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.