From tlumley at u.washington.edu  Tue Jul 22 17:28:54 2003
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Wed Jul 23 01:28:52 2003
Subject: [Rd] abs() and negative output from fractions() (PR#3536)
In-Reply-To: <200307222249.h6MMn5JH029128@pubhealth.ku.dk>
Message-ID: <Pine.A41.4.44.0307221628140.122538-100000@homer41.u.washington.edu>

On Wed, 23 Jul 2003 forporphyry@hotmail.com wrote:

> Hi,
>
> zeros is output from fractions()
>
> >zeros
> [1]   -2 -2/5    1  4/3
> >abs(zeros)
> [1]   -2 -2/5    1  4/3
> >is.numeric(zeros)
> [1] TRUE
> >abs(zeros[1])
> [1] -2
> >as.numeric(zeros)
> [1] -2.000000 -0.400000  1.000000  1.333333
> >abs(as.numeric(zeros))
> [1] 2.000000 0.400000 1.000000 1.333333

Why is this a bug?


	-thomas


Thomas Lumley			Assoc. Professor, Biostatistics
tlumley@u.washington.edu	University of Washington, Seattle


[Rd] abs() and negative output from fractions() (PR#3536)
Thomas Lumley