On May 7, 2011, at 17:21 , Hadley Wickham wrote:

>> 
>> Well, ave() uses interaction(...) and interaction() has a "drop" argument, so
>> 
>>> with(x, ave(H, Site, Prof, drop=TRUE, FUN=function(y)y-min(y)))
>> [1]  8  0 51  0 33 22 21  0
> 
> I don't understand why this isn't the default.
> 
> Hadley

Defensive programming, maybe? It's not the default for interaction(), which 
makes sense, and if you pass a non-default option, you cannot revert it. Not 
that I can think up a case where you'd actually want to process the empty 
levels either.

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd....@cbs.dk  Priv: pda...@gmail.com

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to