Convenience functions to test uniqueness, or to return the number of unique/duplication values, or a unique sorted vector.
The which.unique function returns a vector of indices.
This will produce a vector of unique values, if the original vector is subsetted using the indices.