Hi, I am wondering if a mata command exists for finding the unique values within a vector -- similar to R's unique command, where Au <- unique(A) returns a vector identical to A, but with all repeated values deleted. If for instance, I have A = [1 2 3 3 4 5 5 5 6 6 6 6], I would like the unique command to return a new vector [1 2 3 4 5 6 ]. (The ordering by value is specific to my situation, but of course A might more generally have values that repeat randomly across indices.)
If no mata command exists (and I couldn't find one in the manual), I'd love tips on coding this up! Thanks in advance.
If no mata command exists (and I couldn't find one in the manual), I'd love tips on coding this up! Thanks in advance.
Comment