[R] how to delete columns with NA values?

muting MT208071 at dal.ca
Wed Apr 14 16:56:16 CEST 2010


Hi everyone:

I have a dataset:

tm1
     col1 col2
[1,]    1   NA
[2,]    1    1
[3,]    2    2
[4,]    1    1
[5,]    2    2
[6,]    1   NA

I need to delete entire column 2 that has NA in it(not all of them are NAs),
and the result I want is

tm1
     col1 
[1,]    1  
[2,]    1    
[3,]    2    
[4,]    1    
[5,]    2    
[6,]    1   

what should I do? 
I search a lot, all I found is how to delete column with all NA values..

Thanks a lot

muting

-- 
View this message in context: http://n4.nabble.com/how-to-delete-columns-with-NA-values-tp1839902p1839902.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list