leading_zeros | R Documentation |
Add n
leading zeros to a numeric sequence. This is useful to create a
character vector to rename files in a folder.
leading_zeros(x, n = 3)
x |
A numeric vector or a list of numeric vectors. |
n |
The number of leading zeros to add. Defaults to |
A character vector or a list of character vectors.
library(pliman)
leading_zeros(1:5)
leading_zeros(list(a = 1:3,
b = 1:5),
n = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.