Skip to content
Prev 309424 / 398506 Next

"NA-friendly" operator

On Oct 30, 2012, at 2:25 PM, Berend Hasselman wrote:

            
Don't need to define a new operator. %in% will work fine:

vec<-c(3,4,5,NA,1,NA,9,NA,1)

vec[vec %in% 1]

(Seems a bit silly if you ask me. Using which would seem to provide more minforamtion.)
[1] 5 9