Take the average of the ranks for all ties
Vec(3,6,6,4).rank(tie = stats.RankTie.Avg) == Vec[Double](1,3.5,3.5,2)