I have a vector that looks like this:
v <- c(1,2,2,3,3,3,4,4)
How can I get the elements that are not repeated twice? In other words, they are only present once or more than twice in the vector.
Thank you!
>Solution :
Try subset with ave
> subset(v, ave(v, v, FUN = length) != 2)
[1] 1 3 3 3