[R] Number -> Fraction

Stefano Calza stef at biostatistics.it
Thu Sep 13 17:06:54 CEST 2007


Welcome (benvenuto),


see "fractions" in library MASS

es:

> fractions(1/2)
[1] 1/2

Ciao

Stefano



On Thu, Sep 13, 2007 at 04:54:01PM +0200, Mauro Arnoldi wrote:
<Mauro>Hi everybody!
<Mauro>I'm new to this list and also to the R program.
<Mauro>
<Mauro>I'd like to know if there is a function able to convert results into 
<Mauro>Fractional form like my scientific calculator have. For example:
<Mauro>
<Mauro>> 1/3
<Mauro>[1] 0.3333333
<Mauro>
<Mauro>> function_that_return_a_fraction_from_numbers(0.3333333)
<Mauro>[1] 1/3
<Mauro>
<Mauro>Thanks
<Mauro>
<Mauro>Mauro
<Mauro>
<Mauro>-- 
<Mauro>
<Mauro>
<Mauro>Man, he is constantly growing 
<Mauro>and when he is bound by a set 
<Mauro>pattern of ideas or way
<Mauro>of doing things, that's when
<Mauro>he stops growing
<Mauro>	-- Bruce Lee
<Mauro>
<Mauro>______________________________________________
<Mauro>R-help a r-project.org mailing list
<Mauro>https://stat.ethz.ch/mailman/listinfo/r-help
<Mauro>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
<Mauro>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list