Convert an integer to base36

Viewed 2027

strtoi(x,base=36) will convert a base36-encoded string to an integer:

strtoi("zzzz",base=36)
[1] 1679615

Is there a function that inverts this operation, i.e., given a positive integer yields the base36 equivalent? Essentially, I'm looking for an itostr() function such that

itostr(1679615,base=36)
[1] "zzzz"

(I don't need any base other than 36, but a base argument would be nice to have.)

3 Answers
Related