Skip to content
Prev 86380 / 398506 Next

indexing via a character matrix?

Prof Brian Ripley wrote:
Hmm, I think neither one is what I wanted.  After thinking more about 
it, I think what I would need is

ind1 <- match(df2$A,levels(df1$A))
ind2 <- match(df2$B,levels(df2$B))
cont.table[cbind(ind1,ind2)]

Does this make sense?  Is there a more natural way to express this?

Many thanks,

Roger