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