How about: all.nas <- apply( old, 1, function(x) sum( is.na( x ) ) ) new <- old[all.nas < dim( old )[2], ]
---------------------- Bendix Carstensen Senior Statistician Steno Diabetes Center Niels Steensens Vej 2 DK-2820 Gentofte Denmark tel: +45 44 43 87 38 mob: +45 30 75 87 38 fax: +45 44 43 07 06 [EMAIL PROTECTED] www.biostat.ku.dk/~bxc ---------------------- > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Robert > Brown FM CEFAS > Sent: Monday, November 01, 2004 4:18 PM > To: [EMAIL PROTECTED] > Subject: [R] deleting specified NA values > > > 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 > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read > the posting guide! http://www.R-project.org/posting-guide.html > ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html