powered by
Find first duplicated position
find1stDup(x)
A logical vector
a vector
x=rep(1:5,each=3) which(find1stDup(x))
Run the code above in your browser using DataLab