Skip to content
Prev 35765 / 63424 Next

Proposal unary - operator for factors

Currently, for numeric a you can do either
   order(-a)
or
   order(a, decreasing=FALSE)
For nonnumeric types like POSIXct and factors only
the latter works.

Under my proposal your
   order(a, -b, c, d)
would be
   order(a, b, c, d, decreasing=c(FALSE,TRUE,FALSE,TRUE))
and it would work for any ordably class without modifications
to any classes.

Bill