Re: [R] frequency table-visualization for complex categorical variables

2013-02-26 Thread Niklas Fischer
Thanks Rui, It is very useful indeed. Bests, Niklas 2013/2/26 Rui Barradas > Hello, > > I'm not sure I understand, do you want to treat BCC, CBC and CCB as the > same? If so try > > w2 <- apply( y , 1 , function(x) paste0(sort(x) , collapse = "" )) > > table(w2) > > > Hope this helps, > > Rui Ba

Re: [R] frequency table-visualization for complex categorical variables

2013-02-26 Thread Rui Barradas
Hello, I'm not sure I understand, do you want to treat BCC, CBC and CCB as the same? If so try w2 <- apply( y , 1 , function(x) paste0(sort(x) , collapse = "" )) table(w2) Hope this helps, Rui Barradas Em 26-02-2013 13:58, Niklas Fischer escreveu: Hi again, Thanks for Anthony about the

Re: [R] frequency table-visualization for complex categorical variables

2013-02-26 Thread Niklas Fischer
Hi again, Thanks for Anthony about the links on reproducible codes. Thanks for Rui about ordering when rows are intact. One more question Here is your code. x <- cbind( sample( LETTERS[1:6] , 100 , replace = TRUE ) , sample( LETTERS[1:6] , 100 , replace = TRUE )

Re: [R] frequency table-visualization for complex categorical variables

2013-02-25 Thread Rui Barradas
Hello, I disagree with the way you've sorted the matrix, like this all A's become first, then B's, etc, irrespective of the respondents. Each row is a respondent, and the rows should be kept intact, but with a different ordering. To this effect, use order(): z <- y[order(y[,1], y[,2], y[,3])

Re: [R] frequency table-visualization for complex categorical variables

2013-02-25 Thread Anthony Damico
in the future, please provide R code to re-create some example data :) read http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-examplefor more detail.. # create a data table with three unique columns' values.. # treat these values just like letters x <- cbind(