Re: [R] constructing a contingency table (ftable, table)

2010-06-08 Thread stefan.d...@gmail.com
Hi Joris, thanks for your help. I just had to alter it slightly (basically just transposing): tmp <- array(rbind(t(test),t(test2)), dim=c(9,2,2), dimnames=list(colnames(test),rownames(test),c("Test","Test2"))) ftable(tmp) Thanks again! Best, Stefan On Tue, Jun 8, 2010 at

Re: [R] constructing a contingency table (ftable, table)

2010-06-08 Thread Joris Meys
I could get something close to what you asked using a little hack, emulating a table using an array based on your two matrices : test <- matrix(rpois(18,10),ncol=9,nrow=2) colnames(test) <- paste("Dis",1:9,sep="") rownames(test) <- c("2010","2020") test2 <- matrix(rpois(18,10),ncol=9,nrow=2) coln

[R] constructing a contingency table (ftable, table)

2010-06-08 Thread stefan.d...@gmail.com
Dear all, an hopefully quick table question. I have the following data: Two objects that are 2*9 matrix with nine column names (Dis1, ..., Dis9) and the row names (2010,2020). The content are frequencies (numeric). In want to create a table that is along the lines of ftable(UCBAdmissions) and sho