I have this line of code, but do not know the command under the FUN parameter to create the table proportions:
list(aggregate(df[,xx], by=list(df[,yy]), FUN=p