I have these two vectors:
first<-c(1,2,2,2,3,3,4)
second<-c(1,2)
now I want first
without second
elements to get result like this:(2,2,3,3,4)
; indeed,
I don't want all 2
s removed and only want one by one subtracting.
I have tried this (from here):
'%nin%' <- Negate('%in%')
first<-first[first %nin% second]
but it removes all 2
s from first
and gives this result: (3,3,4)
How can I do that?