> Also, as an extra, it would be very useful if, for instance, > t[u==NA] --> 2 4 6 8 > (I realise that working round this is less cumbersome, but even so). What's wrong with writing t[is.na(u)]? Or you could define eq <- function(x,y) { (is.na(x) & is.na(y)) | (!is.na(x) & !is.na(y) & x == y) } and use t[eq(u,NA)]