Get mode of a data vector. But use the median instead of the mode if all data values are unique.
Mode(x)
x
The data vector
The mode