oehl_list@gmx.de
2002-Aug-13 20:43 UTC
order() with na.last=NA ignores decreasing=TRUE (PR#1906)
Please find replication code below Best Jens Oehlschlägel> x <- c(NA, 1, 2, 3) > order(x, na.last=TRUE, decreasing=FALSE)[1] 2 3 4 1> order(x, na.last=TRUE, decreasing=TRUE)[1] 4 3 2 1> order(x, na.last=FALSE, decreasing=FALSE)[1] 1 2 3 4> order(x, na.last=FALSE, decreasing=TRUE)[1] 1 4 3 2> order(x, na.last=NA, decreasing=FALSE)[1] 2 3 4> # THIS ONE IS FALSE: order() with na.last=NA ignores decreasing=TRUE > order(x, na.last=NA, decreasing=TRUE)[1] 2 3 4>x <- c(NA, 1, 2, 3) order(x, na.last=TRUE, decreasing=FALSE) order(x, na.last=TRUE, decreasing=TRUE) order(x, na.last=FALSE, decreasing=FALSE) order(x, na.last=FALSE, decreasing=TRUE) order(x, na.last=NA, decreasing=FALSE) # THIS ONE IS FALSE: order() with na.last=NA ignores decreasing=TRUE order(x, na.last=NA, decreasing=TRUE)> version_ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 1 minor 5.1 year 2002 month 06 day 17 language R -- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
ripley@stats.ox.ac.uk
2002-Aug-14 06:02 UTC
order() with na.last=NA ignores decreasing=TRUE (PR#1906)
Fixed now. If you need the fix, the do.call line should be
ans <- do.call("order", c(z, decreasing=decreasing))
Thanks!
On Tue, 13 Aug 2002 oehl_list@gmx.de wrote:
>
> Please find replication code below
> Best
>
> Jens Oehlschlägel
>
>
> > x <- c(NA, 1, 2, 3)
> > order(x, na.last=TRUE, decreasing=FALSE)
> [1] 2 3 4 1
> > order(x, na.last=TRUE, decreasing=TRUE)
> [1] 4 3 2 1
> > order(x, na.last=FALSE, decreasing=FALSE)
> [1] 1 2 3 4
> > order(x, na.last=FALSE, decreasing=TRUE)
> [1] 1 4 3 2
> > order(x, na.last=NA, decreasing=FALSE)
> [1] 2 3 4
> > # THIS ONE IS FALSE: order() with na.last=NA ignores decreasing=TRUE
> > order(x, na.last=NA, decreasing=TRUE)
> [1] 2 3 4
> >
>
> x <- c(NA, 1, 2, 3)
> order(x, na.last=TRUE, decreasing=FALSE)
> order(x, na.last=TRUE, decreasing=TRUE)
> order(x, na.last=FALSE, decreasing=FALSE)
> order(x, na.last=FALSE, decreasing=TRUE)
> order(x, na.last=NA, decreasing=FALSE)
> # THIS ONE IS FALSE: order() with na.last=NA ignores decreasing=TRUE
> order(x, na.last=NA, decreasing=TRUE)
>
>
>
> > version
> _
> platform i386-pc-mingw32
> arch i386
> os mingw32
> system i386, mingw32
> status
> major 1
> minor 5.1
> year 2002
> month 06
> day 17
> language R
>
>
> --
>
>
>
>
>
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-devel mailing list -- Read
http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !) To:
r-devel-request@stat.math.ethz.ch
>
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>
--
Brian D. Ripley, ripley@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To:
r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._