freq function

Builds a function to calculate cross-tabulated frequencies