Skip to content

filter on data frame

2 messages · AlessandroSemeria@cramont.it, Michael A. Miller

#
Hello R-list.
Someone know how to delete  rows on a char/num matrix
following some criteria without a loop (something like: my.matrix[my.matrix
[,4]<1e-5],
but this one put within rows, that follow citeria, "NA")?
 Thanks!

A.S.
#
> Hello R-list.  Someone know how to delete rows on a
    > char/num matrix following some criteria without a loop
    > (something like: my.matrix[my.matrix [,4]<1e-5], but this
    > one put within rows, that follow citeria, "NA")?  Thanks!

How about subset and is.na?

Mike
V1   V2
1  1    a
2  2    b
3  3    f
4  4    g
5  5 <NA>
6  6 <NA>
7  7    a
V1 V2
1  1  a
2  2  b
3  3  f
4  4  g
7  7  a