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

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
...@ucalgary.ca Cc: William Dunlap wdun...@tibco.com; David Winsemius dwinsem...@comcast.net; peter dalgaard pda...@gmail.com; r-help@r-project.org r-help@r-project.org Sent: Tuesday, August 28, 2012 2:08 PM Subject: Re: [R] Inexplicably different results using subset vs bracket notation

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

2012-08-28 Thread David Winsemius
ehl...@ucalgary.ca Cc: William Dunlap wdun...@tibco.com; David Winsemius dwinsem...@comcast.net ; peter dalgaard pda...@gmail.com; r-help@r-project.org r-help@r-project.org Sent: Tuesday, August 28, 2012 2:08 PM Subject: Re: [R] Inexplicably different results using subset vs bracket notation

[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)

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

2012-08-27 Thread William Dunlap
] 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 function vs bracket notation? I have a data frame with 65 variables and 4382 rows. When I use

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

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]