Suppose I have a data frame such like:
df<-data.frame(x1=c(0,1,1,1,2,3,3,3),
x2=c(0,1,1,3,2,3,3,2),
x3=c(0,1,1,1,2,3,3,2))
df
x1 x2 x3
1 0 0 0
2 1 1 1
3 1 1 1
4 1 3 1
5 2 2 2
6 3 3 3
7 3 3 3
8 3 2 2
what I want is to count the number of each unique row such like:
x1 x2 x3 count
1 0 0 0 1
2 1 1 1 2
4 1 3 1 1
5 2 2 2 1
6 3 3 3 2
8 3 2 2 1
What's the easiest way to realize it in R?
plyr
so that doesn't matter anymore I guess. $\endgroup$