padInteger {jamba} | R Documentation |
prefix integers with leading zeros
Description
prefix integers with leading zeros
Usage
padInteger(x, padCharacter = "0", useNchar = NULL, ...)
Arguments
x |
|
padCharacter |
|
useNchar |
|
... |
additional parameters are ignored. |
Details
The purpose of this function is to pad integer numbers so they contain a consistent number of digits, which is helpful when sorting values as character strings.
Value
character
vector of length(x).
See Also
Other jam string functions:
asSize()
,
breaksByVector()
,
fillBlanks()
,
formatInt()
,
gsubOrdered()
,
gsubs()
,
makeNames()
,
nameVector()
,
nameVectorN()
,
padString()
,
pasteByRow()
,
pasteByRowOrdered()
,
sizeAsNum()
,
tcount()
,
ucfirst()
Examples
padInteger(c(1, 10, 20, 300, 5000))