-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
orderNumeric doesn't support na.last #198
Comments
I'll check into that. |
Actually, I think we should remove (or deprecate) the library(testthat)
library(MSnbase)
library(microbenchmark)
dat <- rnorm(100000)
## Add some ties:
dat[sample(1:length(dat), 10)] <- 5.4
dat[sample(1:length(dat), 10)] <- 1.123
ordr_1 <- base::order(dat, method = "auto")
ordr_2 <- base::order(dat, method = "shell")
ordr_3 <- base::order(dat, method = "radix")
ordr_4 <- MSnbase:::orderNumeric(dat)
expect_identical(ordr_1, ordr_2)
expect_identical(ordr_2, ordr_3)
expect_identical(ordr_3, ordr_4)
microbenchmark(base::order(dat, method = "auto"),
base::order(dat, method = "shell"),
base::order(dat, method = "radix"),
MSnbase:::orderNumeric(dat))
Unit: milliseconds
expr min lq mean median
base::order(dat, method = "auto") 2.88673 3.048574 3.555444 3.274347
base::order(dat, method = "shell") 18.07733 19.580625 20.769978 20.550710
base::order(dat, method = "radix") 2.83596 3.003941 3.519363 3.185912
MSnbase:::orderNumeric(dat) 14.87096 16.177153 17.342168 16.844887
uq max neval cld
3.788631 6.302562 100 a
21.683892 30.198646 100 c
3.723653 7.537382 100 a
17.942919 30.880739 100 b |
Actually, for backward compatibility, it's better not to use the |
- Deprecate orderNumeric, sortNumeric and orderInteger. - Add warning if parameter `na.last` is used in these functions (issue #198).
IMHO there is no need to deprecated this methods. They are hidden (not exported by |
OK, I'll do - just didn't want to break anything if you have them somewhere in your code. |
Thanks, that's very kind of you but I already replaced everything by |
From: Sebastian Gibb <mail@sebastiangibb.de> git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MSnbase@127876 bc3139a8-67e5-0310-9ffc-ced21a209358
From: Sebastian Gibb <mail@sebastiangibb.de> git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MSnbase@127876 bc3139a8-67e5-0310-9ffc-ced21a209358
The current implementation of
orderNumeric
(or its C implementation ofDouble_order
/_get_order_of_double_array
) doesn't support thena.last
argument.I used
orderNumeric
as fast replacement forbase::order
and expecting it to work identical because of the same API.If it is too hard to implement it I would prefer at least a warning if this argument is set by the user or remove it completely (because it is ignored anyway).
The text was updated successfully, but these errors were encountered: