Here's the sample data:
a <- structure(list(Occ = c(1, 2, 3, 4, 4, 5, 6, 4, 8, 5),
Type = c("A", "B", "C", "A", "A", "A", "B", "C", "C", "B"),
Alc = c("A", "B", "N", "A", "N", "N", "N", "A", "B", "B"),
Count = c(10, 10, 20, 10, 15, 15, 10, 10, 20, 15)),
.Names = c("Occ", "Type", "Alc", "Count"), row.names = c(NA, -10L), class = "data.frame")
I like to get the frequency count of each attribute of the columns like the following:
Occ: Type Alc Count
1: 1 A: 4 A: 3 10: 5
2: 1 B: 3 B: 3 15: 3
3: 1 C: 3 N: 4 20: 2
4: 3
5: 2
6: 1
8: 1
This problem can be solved partially by 'summary' function in 'anacor' package. I am still looking for a better solution.