Re: [R] subset data frame with condition

2011-03-18 Thread Nicolas Gutierrez
perfect, thanks Henrique! Nico On 3/18/2011 11:17 AM, Henrique Dallazuanna wrote: Try this: subset(pop, (ave(Area, Area, FUN = length) == 1 | ave(Area, Area, FUN = function(x)cumsum(prop.table(x)))< 0.7& Area %in% 1:3)) On Fri, Mar 18, 2011 at 2:48 PM, Nicolas Gutierrez wrote: Hello, O

Re: [R] subset data frame with condition

2011-03-18 Thread Petr Savicky
On Fri, Mar 18, 2011 at 10:48:44AM -0700, Nicolas Gutierrez wrote: > Hello, > > One more question.. I have the data.frame "pop": > > xloc yloc gonad indEneW Area > 123 20 516.74 1 0.02 20.21 1 > 223 20 1143.20 1 0.02 20.21 1 > 323 20 250.00 1

Re: [R] subset data frame with condition

2011-03-18 Thread Petr Savicky
On Fri, Mar 18, 2011 at 10:48:44AM -0700, Nicolas Gutierrez wrote: > Hello, > > One more question.. I have the data.frame "pop": > > xloc yloc gonad indEneW Area > 123 20 516.74 1 0.02 20.21 1 > 223 20 1143.20 1 0.02 20.21 1 > 323 20 250.00 1

Re: [R] subset data frame with condition

2011-03-18 Thread Henrique Dallazuanna
Try this: subset(pop, (ave(Area, Area, FUN = length) == 1 | ave(Area, Area, FUN = function(x)cumsum(prop.table(x))) < 0.7 & Area %in% 1:3)) On Fri, Mar 18, 2011 at 2:48 PM, Nicolas Gutierrez wrote: > Hello, > > One more question.. I have the data.frame "pop": > >    xloc yloc  gonad  ind    En

[R] subset data frame with condition

2011-03-18 Thread Nicolas Gutierrez
Hello, One more question.. I have the data.frame "pop": xloc yloc gonad indEneW Area 123 20 516.74 1 0.02 20.21 1 223 20 1143.20 1 0.02 20.21 1 323 20 250.00 1 0.02 20.21 1 422 15 251.98 1 0.02 18.69 2 522 15 598.08