Re: [R] conditional selection of dataframe rows

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 6:15 PM, David Winsemius wrote: On Aug 12, 2010, at 5:20 PM, Toby Gass wrote: Hi, I do want to look only at slope. If there is one negative slope measurement for a given day and a given chamber, I would like to remove all other slope measurements for that day and that c

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 5:20 PM, Toby Gass wrote: Hi, I do want to look only at slope. If there is one negative slope measurement for a given day and a given chamber, I would like to remove all other slope measurements for that day and that chamber, even if they are positive. On one day, I will

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread Toby Gass
Hi, I do want to look only at slope. If there is one negative slope measurement for a given day and a given chamber, I would like to remove all other slope measurements for that day and that chamber, even if they are positive. On one day, I will have 20 slope measurements for each chamber.

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread Marc Schwartz
On Aug 12, 2010, at 3:06 PM, Toby Gass wrote: > Thank you all for the quick responses. So far as I've checked, > Marc's solution works perfectly and is quite speedy. I'm still > trying to figure out what it is doing. :) > > Henrique's solution seems to need some columns somewhere. David's

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 4:06 PM, Toby Gass wrote: Thank you all for the quick responses. So far as I've checked, Marc's solution works perfectly and is quite speedy. I'm still trying to figure out what it is doing. :) Henrique's solution seems to need some columns somewhere. David's solution do

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread Toby Gass
Thank you all for the quick responses. So far as I've checked, Marc's solution works perfectly and is quite speedy. I'm still trying to figure out what it is doing. :) Henrique's solution seems to need some columns somewhere. David's solution does not find all the other measurements, possibl

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread Marc Schwartz
On Aug 12, 2010, at 2:24 PM, Marc Schwartz wrote: > On Aug 12, 2010, at 2:11 PM, Toby Gass wrote: > >> Dear helpeRs, >> >> I have a dataframe (14947 x 27) containing measurements collected >> every 5 seconds at several different sampling locations. If one >> measurement at a given location is

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread Marc Schwartz
On Aug 12, 2010, at 2:11 PM, Toby Gass wrote: > Dear helpeRs, > > I have a dataframe (14947 x 27) containing measurements collected > every 5 seconds at several different sampling locations. If one > measurement at a given location is less than zero on a given day, I > would like to delete al

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread Henrique Dallazuanna
Try this: subset(toy, !rowSums(mapply(is.element, toy[c('CH', 'DAY')], subset(toy, SLOPE < 0, CH:DAY))) > 1 | SLOPE < 0) On Thu, Aug 12, 2010 at 4:11 PM, Toby Gass wrote: > Dear helpeRs, > > I have a dataframe (14947 x 27) containing measurements collected > every 5 seconds at several differen

Re: [R] conditional selection of dataframe rows

2010-08-12 Thread David Winsemius
On Aug 12, 2010, at 3:11 PM, Toby Gass wrote: Dear helpeRs, I have a dataframe (14947 x 27) containing measurements collected every 5 seconds at several different sampling locations. If one measurement at a given location is less than zero on a given day, I would like to delete all measuremen