R function `duplicated`

Couldn’t you do

i = unique(j -> v[j], eachindex(v))
v[i]

for this purpose? This gives you an index array that you could re-use to extract corresponding slices of other arrays too.

See also the discussions at Return index vectors from unique · Issue #1845 · JuliaLang/julia · GitHub and
Is there a function similar to numpy unique with inverse? - #6 by stevengj

1 Like