I have a data set like this.
a <- structure(list(Prone = c("M", "N", "N", "N", "M", "N", "M", "N", "M", "M"),
Type = c("A", "B", "C", "A", "A", "A", "B", "B", "C", "B"),
Alc = c("A", "B", "N", "A", "A", "A", "B", "B", "B", "B"),
Com = c("Y", "N", "Y", "Y", "Y", "Y", "Y", "N", "N", "Y")),
.Names = c("Prone", "Type", "Alc", "Com"), row.names = c(NA, -10L), class = "data.frame")
a
Prone Type Alc Com
1 M A A Y
2 N B B N
3 N C N Y
4 N A A Y
5 M A A Y
6 N A A Y
7 M B B Y
8 N B B N
9 M C B N
10 M B B Y
I like to get the frequency count of each unique row like the following:
Prone Type Alc Com Freq
1 M A A Y 2
2 M B B Y 2
3 M C B N 1
4 N A A Y 2
5 N B B N 2
6 N C N Y 1
Thanks in advance.
See Question&Answers more detail:
os