Re: [R] removing fields of the same group from a data frame

2010-03-24 Thread Marc Schwartz
On Mar 24, 2010, at 8:38 AM, Oscar Franzén wrote: > Dear all, > > I'm trying to find a a way to remove certain fields belonging to the same > group from a data frame structure. > > I have a data frame like this: > > foo v1 v2 v3 > 1 1 a > 6 2 a > 3 8 a > 4 4 b >

Re: [R] removing fields of the same group from a data frame

2010-03-24 Thread Henrique Dallazuanna
Try this: subset(foo, v3 %in% names(which(!table(foo$v3) < 3))) On Wed, Mar 24, 2010 at 10:38 AM, Oscar Franzén wrote: > Dear all, > > I'm trying to find a a way to remove certain fields belonging to the same > group from a data frame structure. > > I have a data frame like this: > >  foo v1 v2

[R] removing fields of the same group from a data frame

2010-03-24 Thread Oscar Franzén
Dear all, I'm trying to find a a way to remove certain fields belonging to the same group from a data frame structure. I have a data frame like this: foo v1 v2 v3 1 1 a 6 2 a 3 8 a 4 4 b 4 4 b 2 1 c 1 6 d Each row can then be group