[R] Number -> Fraction

2007-09-13 Thread Mauro Arnoldi
Hi everybody! I'm new to this list and also to the R program. I'd like to know if there is a function able to convert results into Fractional form like my scientific calculator have. For example: > 1/3 [1] 0.333 > function_that_return_a_fraction_from_numbers(0.333) [1] 1/3 Thanks Maur

Re: [R] Number -> Fraction

2007-09-13 Thread Stefano Calza
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: Hi everybody! I'm new to this list and also to the R program. I'd like to know if there is a function able to convert results into

Re: [R] Number -> Fraction

2007-09-13 Thread Katharine Mullen
look at ?fractions > fractions(.3) [1] 1/3 On Thu, 13 Sep 2007, Mauro Arnoldi wrote: > Hi everybody! > I'm new to this list and also to the R program. > > I'd like to know if there is a function able to convert results into > Fractional form like my scientific calculator have. For example: >

Re: [R] Number -> Fraction

2007-09-13 Thread Uwe Ligges
Mauro Arnoldi wrote: > Hi everybody! > I'm new to this list and also to the R program. > > I'd like to know if there is a function able to convert results into > Fractional form like my scientific calculator have. For example: > >> 1/3 > [1] 0.333 > >> function_that_return_a_fraction_from

Re: [R] Number -> Fraction

2007-09-13 Thread Gabor Grothendieck
Try: library(MASS) ?fractions On 9/13/07, Mauro Arnoldi <[EMAIL PROTECTED]> wrote: > Hi everybody! > I'm new to this list and also to the R program. > > I'd like to know if there is a function able to convert results into > Fractional form like my scientific calculator have. For example: > > > 1

Re: [R] Number -> Fraction

2007-09-13 Thread Thomas Lumley
On Thu, 13 Sep 2007, Mauro Arnoldi wrote: > Hi everybody! > I'm new to this list and also to the R program. > > I'd like to know if there is a function able to convert results into > Fractional form like my scientific calculator have. For example: > >> 1/3 > [1] 0.333 > >> function_that_return

Re: [R] Number -> Fraction

2007-09-13 Thread Ravi Varadhan
11:34 AM To: Mauro Arnoldi Cc: r-help@r-project.org Subject: Re: [R] Number -> Fraction On Thu, 13 Sep 2007, Mauro Arnoldi wrote: > Hi everybody! > I'm new to this list and also to the R program. > > I'd like to know if there is a function able to convert results into >

Re: [R] Number -> Fraction

2007-09-13 Thread Thomas Lumley
-- > > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Thomas Lumley > Sent: Thursday, September 13, 2007 11:34 AM > To: Mauro Arnoldi > Cc: r-help@r-project.org > Subject: Re: [R] Number -> Fraction > > O

Re: [R] Number -> Fraction

2007-09-13 Thread Mauro Arnoldi
Alle giovedì 13 settembre 2007, Stefano Calza ha scritto: > > see "fractions" in library MASS > Yeah! > 1/3 [1] 0.333 > fractions(0.333) [1] 1/3 Great! Thanks! (grazie :) ) Mauro __ R-help@r-project.org mailing list https://stat.ethz.ch/mailm

Re: [R] Number -> Fraction

2007-09-13 Thread Alberto Monteiro
Ravi Varadhan wrote: > > Finding sufficiently accurate rational approximations to a real > number, can be done using fractions() in MASS, which uses > continued fractions. > In a slight off-topic digression, I recently learned that any irrational number that can be nicely approximated by rational