Re: [R] Cross tabulation with fixed dimensions

2010-03-05 Thread David Winsemius
On Mar 5, 2010, at 11:43 AM, Tarmo Remmel wrote: Hello, This is a seemingly simple task, but it has been frustrating me for too long, so I am turning to this list for some help. I have two vectors of factors which are quite long; two simple examples are shown here: No, those are not "

Re: [R] Cross tabulation with fixed dimensions

2010-03-05 Thread Gabor Grothendieck
Those are numerical, not factors. If they were factors all levels would be represented. > a <- factor(c(1,2,3,4,5), levels = 1:5) > b <- factor(c(1,2,5,5,6), levels = 1:6) > table(a, b) b a 1 2 3 4 5 6 1 1 0 0 0 0 0 2 0 1 0 0 0 0 3 0 0 0 0 1 0 4 0 0 0 0 1 0 5 0 0 0 0 0 1 On Fri, M