[R] Noval numbers

Duncan Murdoch murdoch at stats.uwo.ca
Sun Feb 7 22:54:37 CET 2010


On 07/02/2010 4:25 PM, Mag. Ferri Leberl wrote:
> Dear everybody,
> How can I transform numbers to a positional system with the base of, e.g., nine, and do further operations with them?

I don't understand what you want.  Decimal, noval or binary are just 
ways to represent numbers as strings of characters.  It doesn't make 
sense to me to say you are "transforming them" to a particular 
representation.  You can represent them in a variety of ways:  10 
(decimal), 11 (noval), 1010 (binary), ten (English), but it's still the 
same number.

It does make sense to ask if you can convert numbers to one of these 
representations, or convert the representation back to the number; is 
that what you meant?  Erich Neuwirth posted a function to do one way 
conversions:

http://finzi.psych.upenn.edu/Rhelp10/2008-September/175003.html

With his functions you can do

 > makeDigitSeq(numberInBase(10, 9))
[1] "11"

Duncan Murdoch



> Thank you in advance
> Yours, sincerely
> Mag. Ferri Leberl
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list