itostr | R Documentation |
Converts integers to strings by the given base and character count.
itostr(x, base = 10L, nchars = 0L)
x |
Integer vector, or something coercible to this by |
base |
Integer between 2 and 11 inclusive. |
nchars |
Minimum number of characters desired. Shorter strings are left-padded with zeros. |
A character vector of the same length as x
.
strtoi
for the reverse conversion.
itostr(123, nchars = 4)
strtoi(itostr(123, base = 2), base = 2)
itostr(c(0, 1, 2, 10), base = 2)
itostr(c(0, 1, 2, 10), base = 2, nchars = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.