Re: [R] Inexplicably different results using subset vs bracket notation on logical variable

2012-08-28 Thread David Winsemius
_ From: Peter Ehlers Cc: William Dunlap ; David Winsemius >; peter dalgaard ; "r-help@r-project.org" > Sent: Tuesday, August 28, 2012 2:08 PM Subject: Re: [R] Inexplicably different results using subset vs bracket notation on logical variable On 2012-08-28 0

Re: [R] Inexplicably different results using subset vs bracket notation on logical variable

2012-08-28 Thread Mauricio Cornejo
___ From: Peter Ehlers Cc: William Dunlap ; David Winsemius ; peter dalgaard ; "r-help@r-project.org" Sent: Tuesday, August 28, 2012 2:08 PM Subject: Re: [R] Inexplicably different results using subset vs bracket notation on logical variable On 2012-08-28 07:44, M

Re: [R] Inexplicably different results using subset vs bracket notation on logical variable

2012-08-28 Thread Peter Ehlers
On 2012-08-28 07:44, Mauricio Cornejo wrote: William, David, and Peter, Thank you all so much for your help on this. Though I had read the help files on 'subset' and '[', I had not been able to discern from that text what the problem was. I could not have solved it without your help. The

Re: [R] Inexplicably different results using subset vs bracket notation on logical variable

2012-08-28 Thread Mauricio Cornejo
William, David, and Peter, Thank you all so much for your help on this.  Though I had read the help files on 'subset' and '[', I had not been able to discern from that text what the problem was.  I could not have solved it without your help. The help file on 'subset' mentions "For ordinary ve

Re: [R] Inexplicably different results using subset vs bracket notation on logical variable

2012-08-27 Thread peter dalgaard
On Aug 28, 2012, at 05:11 , David Winsemius wrote: > That's exactly it. If a logical index returns NA, its row is included in the > output of "[" extraction. You can correct what I consider a failing and > others consider a feature with: > > df[df$Renewal==TRUE & !is.na(df$Renewal), 1:2] > P

Re: [R] Inexplicably different results using subset vs bracket notation on logical variable

2012-08-27 Thread David Winsemius
On Aug 27, 2012, at 5:08 PM, Mauricio Cornejo wrote: Hi, Would anyone have any idea as to why I would obtain completely different results when subsetting using the subset function vs bracket notation? I have a data frame with 65 variables and 4382 rows. When I use execute the following

Re: [R] Inexplicably different results using subset vs bracket notation on logical variable

2012-08-27 Thread William Dunlap
gt; To: r-help@r-project.org > Subject: [R] Inexplicably different results using subset vs bracket notation > on logical > variable > > Hi, > > Would anyone have any idea as to why I would obtain completely different > results when > subsetting using the subset functio

[R] Inexplicably different results using subset vs bracket notation on logical variable

2012-08-27 Thread Mauricio Cornejo
Hi, Would anyone have any idea as to why I would obtain completely different results when subsetting using the subset function vs bracket notation? I have a data frame with 65 variables and 4382 rows. When I use execute the following subset command I get the correct results (125 rows) > subset(