collapse function

Reduces a vector to a frequency vector