Re: [R] Most common level of a factor by

2008-08-30 Thread Douglas Bates
On Fri, Aug 29, 2008 at 6:46 PM, David Huffer <[EMAIL PROTECTED]> wrote: > I'm looking for something along the lines of > > which ( table ( x ) == max ( table ( x ) ) ) > > to find the most common level of one factor > by several other factors. For instance, I've got > > X <- data.frame ( > +

[R] Most common level of a factor by

2008-08-29 Thread David Huffer
I'm looking for something along the lines of which ( table ( x ) == max ( table ( x ) ) ) to find the most common level of one factor by several other factors. For instance, I've got > X <- data.frame ( + x = factor ( sample ( c ( "A" , "B" , "C" , "D" ) , 20 , r = T ) ) + , z1 = fac