Re: [R] Select rows based on matching conditions and logical operators

2012-07-25 Thread arun
1 2 6755 53122 2009 3 2 A.K. - Original Message - From: kborgmann To: r-help@r-project.org Cc: Sent: Wednesday, July 25, 2012 1:10 PM Subject: [R] Select rows based on matching conditions and logical operators Hi, I have a dataset in which I would like to select rows based

Re: [R] Select rows based on matching conditions and logical operators

2012-07-25 Thread William Dunlap
---Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of William Dunlap > Sent: Wednesday, July 25, 2012 3:37 PM > To: Bert Gunter; Rui Barradas > Cc: r-help > Subject: Re: [R] Select rows based on matching conditions and logic

Re: [R] Select rows based on matching conditions and logical operators

2012-07-25 Thread William Dunlap
ter.ber...@gene.com] > Sent: Wednesday, July 25, 2012 3:04 PM > To: Rui Barradas > Cc: William Dunlap; r-help > Subject: Re: [R] Select rows based on matching conditions and logical > operators > > Wouldn't > > > interaction(..., drop=TRUE) > > be the sam

Re: [R] Select rows based on matching conditions and logical operators

2012-07-25 Thread Bert Gunter
0 >> 6 6755 53122 2008 3 1 >> 9 6755 53122 2009 3 2 >> When there are a lot of output rows the f2 can be quite a bit faster. >> >> (I put the call to droplevels(interaction(...)) into the call to ave >> because ave >> can waste a lot of time c

Re: [R] Select rows based on matching conditions and logical operators

2012-07-25 Thread Rui Barradas
for nonexistent interaction levels.) Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Rui Barradas Sent: Wednesday, July 25, 2012 10:24 AM To: kborgmann Cc: r-help Subject:

Re: [R] Select rows based on matching conditions and logical operators

2012-07-25 Thread William Dunlap
Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Rui Barradas > Sent: Wednesday, July 25, 2012 10:24 AM > To: kborgmann > Cc: r-help > Subject: Re: [R] Se

Re: [R] Select rows based on matching conditions and logical operators

2012-07-25 Thread kborgmann
Thanks! which.max did the trick -- View this message in context: http://r.789695.n4.nabble.com/Select-rows-based-on-matching-conditions-and-logical-operators-tp4637809p4637816.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-

Re: [R] Select rows based on matching conditions and logical operators

2012-07-25 Thread Rui Barradas
Hello, Apart from the output order this does it. (I have changed 'df' to 'df1', 'df' is an R function, the F distribution density.) df1 <- read.table(text=" PGID PTID Year Visit Count 6755 53121 2009 1 0 6755 53121 2009 2 0 6755 53121 2009 3 0 6755 53122 2008 1 0 6755 53122 2008 2 0 6755 531

[R] Select rows based on matching conditions and logical operators

2012-07-25 Thread kborgmann
Hi, I have a dataset in which I would like to select rows based on matching conditions and return the maximum value of a variable else return one row if duplicate counts exist. My dataset looks like this: PGIDPTIDYear Visit Count 675553121 20091 0 675553121 2009