From wdunlap at tibco.com  Thu Feb  4 00:28:04 2010
From: wdunlap at tibco.com (William Dunlap)
Date: Wed, 3 Feb 2010 15:28:04 -0800
Subject: [Rd] Proposal unary - operator for factors
In-Reply-To: <f8e6ff051002031510m4dca3c8co8d69c3117e1deab4@mail.gmail.com>
References: <f8e6ff051002031510m4dca3c8co8d69c3117e1deab4@mail.gmail.com>
Message-ID: <77EB52C6DD32BA4D87471DCD70C8D7000275B14F@NA-PA-VBE03.na.tibco.com>


> -----Original Message-----
> From: r-devel-bounces at r-project.org 
> [mailto:r-devel-bounces at r-project.org] On Behalf Of Hadley Wickham
> Sent: Wednesday, February 03, 2010 3:10 PM
> To: r-devel at r-project.org
> Subject: [Rd] Proposal unary - operator for factors
> 
> Hi all,
> 
> Why not make the unary minus operator return the factor with levels
> reversed?  This would make it much easier to sort factors in
> descending order in part of an order statement.

It wouldn't make sense in the context of
   vector[-factor]

Wouldn't it be better to allow order's decreasing argument
to be a vector with one element per ... argument?  That
would work for numbers, factors, dates, and anything
else.  Currently order silently ignores decreasing[2] and
beyond.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com 

> 
> Hadley
> 
> -- 
> http://had.co.nz/
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 



[Rd] Proposal unary - operator for factors
William Dunlap