[R] working with fractions

Muhammad Subianto msubianto at gmail.com
Thu Jun 21 19:57:30 CEST 2007


Federico Calboli wrote:
> Hi All,
>
> I am writing a fucntion where I would like to use fractions for all the 
> (numerous) passages.
>
> Is there a way of creating an environment *within a fucntion* so that all the 
> numbers/calculations are fractions?
>
> Best,
>
> Fede
>
>
>   
Maybe like this:

 > library(MASS)
 > as.fractions(c(0, 0.15, 0.8266667, .066666, 0.2666666))
[1]     0  3/20 62/75  1/15  4/15
 >

Regards, Muhammad Subianto



More information about the R-help mailing list