x<-matrix(c(
c(1,1,1,1,1,1,1,1,1),
c(2,2,2,2,2,1,1,1,1), #exchangeable labels are allowed
c(1,1,1,1,1,2,2,2,2),
c(2,2,1,2,2,3,3,3,3),
c(1,1,2,1,1,3,3,3,3),
c(1,1,2,1,1,3,3,3,3),
c(1,1,2,3,4,5,5,5,5),
c(1,1,2,3,4,5,5,5,5),
c(1,2,3,4,5,6,7,8,9)), ncol=9, byrow=TRUE) #each iteration in a row
# this creates a matrix of labels
labtotab<-labeltotable(x)
# counts labels and summarises x
labtotab$lab
#gives labels
labtotab$freq
#gives the corresponding freqencies to the labels
Run the code above in your browser using DataLab