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
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
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
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
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
5 matches
Mail list logo