[R] Finding indices of NA values in a data frame

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Fri Jul 8 22:30:57 CEST 2005



Ken Termiso wrote:
> Hi all,
> 
> I've got a data frame with NA values scattered throughout. I would like to 
> find the rows which contain an NA. Trying to find the indices of the NAs 
> with grep() doesn't work (apparently you can't convert NA to "NA" character 
> value, even with as.character()) so I was hoping someone could tell me how 
> to find rows which contain NA.
> 
> Thanks in advance,
> -Ken
> 

?is.na or ?complete.cases

--sundar




More information about the R-help mailing list