[R] NA values trimming

David Winsemius dwinsemius at comcast.net
Sun Jul 5 15:24:06 CEST 2009


On Jul 4, 2009, at 9:22 PM, nyk wrote:

>
> I have a data matrix containing quite a lot of missing values (NA).  
> I know
> how to remove all column or rows containing NA values, but is there  
> a some
> standard method for removing not all NA containing rows/column, but  
> only
> those which have significantly more NAs than others?

You have not defined what you mean by "significantly more than the  
others" so perhaps all you want to know is haw to count the NA's in a  
vector:

 > x=c(1,2,3,NA, 5,6,NA)
 > sum(is.na(x))
[1] 2
>

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list