Efficient function to perform sort(unique(v))
sortd(v)
v
Vector
numerical sorted vector without duplicates
v <- c(1,1,4,5) sortd(v)