Add function to calculate prevalence overall or by grouping factor The simplest thing is to return a data frame. An alternative would be to use a list, that could have print, plot, top and max methods.