Re: [R] A query about na.omit

2009-04-02 Thread Jose Iparraguirre D'Elia
Mark, Ted, Gabor, Thanks for all your input. José -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: 01 April 2009 18:12 To: Jose Iparraguirre D'Elia Cc: r-help@r-project.org Subject: Re: [R] A query about na.omit First input the data frame: &g

Re: [R] A query about na.omit

2009-04-01 Thread Bernardo Rangel Tura
On Wed, 2009-04-01 at 16:49 +0100, Jose Iparraguirre D'Elia wrote: > Dear all, > > Say I have the following dataset: > > > DF > x y z > [1] 1 1 1 > [2] 2 2 2 > [3] 3 3NA > [4] 4 NA 4 > [5] NA 5 5 > > And I want to omit all the rows whi

Re: [R] A query about na.omit

2009-04-01 Thread Gabor Grothendieck
First input the data frame: > Lines <- "x y z +1 1 1 +2 2 2 +3 3NA +4 NA 4 + NA 5 5" > > DF <- read.table(textConnection(Lines), header = TRUE) > # Now uses complete.cases to get required rows: > > DF[complete.cases(DF[1:2]),] x y z 1

Re: [R] A query about na.omit

2009-04-01 Thread Ted Harding
On 01-Apr-09 15:49:40, Jose Iparraguirre D'Elia wrote: > Dear all, > Say I have the following dataset: > >> DF > x y z > [1] 1 1 1 > [2] 2 2 2 > [3] 3 3NA > [4] 4 NA 4 > [5] NA 5 5 > > And I want to omit all the rows which have NA, but o

[R] A query about na.omit

2009-04-01 Thread Jose Iparraguirre D'Elia
Dear all, Say I have the following dataset: > DF x y z [1] 1 1 1 [2] 2 2 2 [3] 3 3NA [4] 4 NA 4 [5] NA 5 5 And I want to omit all the rows which have NA, but only in columns X and Y, so that I get: x y z 1 1 1 2 2 2 3 3 NA