问题 anyone know if there's a build in function in R that can return indices of duplicated elements corresponding to the unique elements? For instance I have a vector a <- ["A","B","B","C","C"] unique(a) will give ["A","B","C"] duplicated(a) will give [F,F,T,F,T] is there a build-in function to get a vector of indices for the same length as original vector a, that shows the location a's elements in the unique vecor (which is [1,2,2,3,3] in this example)? i.e., something like the output variable