[R] Weird behaviour of order() when having multiple ties
@v|gro@@ @end|ng |rom ver|zon@net
Sun Jan 30 21:17:03 CET 2022
I did not replicate your results as it works fine and applying the order result in a sorted properly result:
 0.1 0.1 0.2 0.3 0.5 0.6
I am using a more recent version of R, but for something this basic, it should not matter as even older versions should do this fine.
R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
Consider restarting your R cleanly with no variables in place before reporting an error.
From: Stefan Fleck <stefan.b.fleck using gmail.com>
To: r-help using r-project.org
Sent: Sun, Jan 30, 2022 4:16 am
Subject: [R] Weird behaviour of order() when having multiple ties
I am experiencing a weird behavior of `order()` for numeric vectors. I
tested on 3.6.2 and 4.1.2 for windows and R 4.0.2 on ubuntu. Can anyone
## Result [should be in order]
 5 6 4 3 2 1
The sort order is obviously wrong. This only occurs if i have multiple
ties. The problem does _not_ occur for decreasing = TRUE.
[[alternative HTML version deleted]]
R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help