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.
filter on data frame
2 messages · AlessandroSemeria@cramont.it, Michael A. Miller
"AlessandroSemeria" == AlessandroSemeria <AlessandroSemeria at cramont.it> writes:
> 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
df
V1 V2 1 1 a 2 2 b 3 3 f 4 4 g 5 5 <NA> 6 6 <NA> 7 7 a
subset(df,!is.na(V2))
V1 V2 1 1 a 2 2 b 3 3 f 4 4 g 7 7 a