CreateContTable with by/sapply/sapply loop