[R] Subsetting a data frame by a factor, using the level that occurs the most times

2005-01-20 Thread michael watson \(IAH-C\)
I think that title makes sense... I hope it does... I have a data frame, one of the columns of which is a factor. I want the rows of data that correspond to the level in that factor which occurs the most times. I can get a list by doing: by(data,data$pattern,subset) And go through each

RE: [R] Subsetting a data frame by a factor, using the level that occurs the most times

2005-01-20 Thread Liaw, Andy
From: Douglas Bates michael watson (IAH-C) wrote: I think that title makes sense... I hope it does... I have a data frame, one of the columns of which is a factor. I want the rows of data that correspond to the level in that factor which occurs the most times. So first you

Re: [R] Subsetting a data frame by a factor, using the level that occurs the most times

2005-01-20 Thread Douglas Bates
Liaw, Andy wrote: From: Douglas Bates michael watson (IAH-C) wrote: I think that title makes sense... I hope it does... I have a data frame, one of the columns of which is a factor. I want the rows of data that correspond to the level in that factor which occurs the most times. So first you

RE: [R] Subsetting a data frame by a factor, using the level that occurs the most times

2005-01-20 Thread Liaw, Andy
From: Douglas Bates Liaw, Andy wrote: From: Douglas Bates michael watson (IAH-C) wrote: I think that title makes sense... I hope it does... I have a data frame, one of the columns of which is a factor. I want the rows of data that correspond to the level in that factor which