counts function

Count observations by unique values