In a toy problem of mine, I have a vector a
made of integers and I want to efficiently remove from a
terms that are also in a vector b
. I wrote the code
newa=NULL
for (j in 1:length(a))
if (min(abs(a[i]-b))>0) newa=c(newa,a[i])
but this is terrible...