Skip to content
Prev 304421 / 398503 Next

return first index for each unique value in a vector

Here are two methods:
uniqueValue firstIndex
1           9          1
2           2          2
3           5          4
[1] TRUE
user  system elapsed 
   0.25    0.02    0.27
user  system elapsed 
   0.09    0.02    0.11
[1] TRUE

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com