#without subsetting function, use: if 'dat' is the vector 1 2 3 4, and you wanted it without '2' you would use 'dat %w/o% 2' "%w/o%"<-function(x,y) x[!x %in% y]