Skip to content

Bug/Wishlist: 'partial' in 'sort' and 'quantile' (PR#8650)

1 message · Deepayan Sarkar

#
Hi,

This is essentially a reposting of

http://tolstoy.newcastle.edu.au/R/devel/05/11/3305.html

which had no responses, and the behaviour reported there persists in
r-devel as of yesterday.

(1) sort() with non-null partial
[1] 0.05 0.00 0.04 0.00 0.00
[1] 52.04  0.02 52.08  0.00  0.00

This is perhaps not strictly a bug, but taking approximately 1000
times longer to do a subset of the work seems pointless at best.

(2) quantile.default() always calls sort() with a non-null partial
argument. Consequently,
[1] 88.82  0.05 88.90  0.00  0.00

There's no way around this except by writing a custom version of
quantile. lattice currently does this, giving
[1] 0.07 0.01 0.08 0.00 0.00

Which brings me to my wishlist request: if (1) cannot be fixed easily,
could quantile.default() at least have an optional argument that can
be used to disable partial sorting?
Version 2.3.0 Under development (unstable) (2006-02-28 r37448)
x86_64-unknown-linux-gnu

attached base packages:
[1] "methods"   "stats"     "graphics"  "grDevices" "utils"     "datasets"
[7] "base"

Deepayan
--
http://www.stat.wisc.edu/~deepayan/