powered by
This is the counterpart of strtoi. For a base greater than ‘10’, letters ‘a’ to ‘z’ are used to represent ‘10’ to ‘35’.
strtoi
itostr(x, base = 10L)
character(length(x)).
character(length(x))
[integer] Vector of integers to convert.
integer
[integer(1)] Base for conversion. Values between 2 and 36 (inclusive) are allowed.
integer(1)
# binary representation of the first 10 natural numbers itostr(1:10, 2) # base36 encoding of a large number itostr(1e7, 36)
Run the code above in your browser using DataLab