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

Thomas Lumley tlumley at u.washington.edu
Tue Jul 22 17:28:54 MEST 2003


On Wed, 23 Jul 2003 forporphyry at 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 at u.washington.edu	University of Washington, Seattle



More information about the R-devel mailing list