I see that there is a built-in function for the...rather abstract...use of transforming from the a decimal representation to roman numerals (Convert roman numerals to numbers in R), but I'm not able to find a built-in way to convert from decimal to other, similar, systems, like base 3 or base 11. I see that binary and hex (base 16) are well supported, but is there a package for converting to/from an arbitrary positional numeral system.
I could make such a package, but I suspect it already exists and my google-fu is just falling short?
You could write your own S3 class:
Which will need a
formatandprintmethod:We also need to make sure that maths operations work properly:
And if you want to use it inside a data frame you need an
as.data.framemethod:Which all allows the following behaviour:
And: