how do you test whether a vector contains repetitive elements in R?
I think I found the answer. Use duplicated() function:
a=c(3,5,7,2,7,9) b=1:10 any(duplicated(a)) #True any(duplicated(b)) #False