[R] Order with scientific notations
Kevin Wang
Kevin.Wang at maths.anu.edu.au
Thu Aug 26 07:46:16 CEST 2004
Hi,
If a value like 8e-04 is in a data frame, is the following behaviour normal?
> final.df
Chr P.values
1 1 0.0379
2 6 0.068
3 2 0.0025
4 13 8e-04
5 14 0.0244
6 3 0.0279
7 4 0.1561
8 5 0.9261
9 7 0.0011
10 9 0.5125
11 10 0.2196
12 11 0.6457
13 18 0.9272
> final.sorted <- data.frame(final.df[order(final.df$P.values), ],
+ row.names = 1:13)
> final.sorted
Chr P.values
1 7 0.0011
2 2 0.0025
3 14 0.0244
4 3 0.0279
5 1 0.0379
6 6 0.068
7 4 0.1561
8 10 0.2196
9 9 0.5125
10 11 0.6457
11 5 0.9261
12 18 0.9272
13 13 8e-04
I'd think 8e-04 should be the smallest value...? It's R 1.9.1 on
Windows XP if that helps.
Cheers,
Kevin
--
Ko-Kang Kevin Wang
PhD Student
Centre for Mathematics and its Applications
Building 27, Room 1004
Mathematical Sciences Institute (MSI)
Australian National University
Canberra, ACT 0200
Australia
Homepage: http://wwwmaths.anu.edu.au/~wangk/
Ph (W): +61-2-6125-2431
Ph (H): +61-2-6125-7407
Ph (M): +61-40-451-8301
More information about the R-help
mailing list