[R] deleting specified NA values

Liaw, Andy andy_liaw at merck.com
Mon Nov 1 16:31:39 CET 2004


This sort of things are most likely covered in `An Introduction to R':

newDATA <- DATA[!is.na(DATA$age),]

Andy

> From:  Robert Brown FM CEFAS
> 
> I have a data set of about 10000 records which was compiled 
> from several smaller data sets using SPSS. During compilation 
> 88 false records were accidentally introduced which comprise 
> all NA values.  I want to delete these records but not other 
> missing data.  The functions na.exclude and na.omit seem to 
> remove all values of NA? How can I delete just the relevant 
> NA's?  . i.e. I want to delete  all records in the data frame 
> DATA where the field age contains NA values
> 
> Regards,
> 
> Robert Brown
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>




More information about the R-help mailing list