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

forporphyry at hotmail.com forporphyry at hotmail.com
Wed Jul 23 01:49:05 MEST 2003


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
>version
         _
platform i386-pc-mingw32
arch     i386
os       mingw32
system   i386, mingw32
status
major    1
minor    7.1
year     2003
month    06
day      16
language R

graham lawrence



More information about the R-devel mailing list