[R] Cross-tabulations next to each other

Charilaos Skiadas skiadas at hanover.edu
Thu Feb 22 17:12:27 CET 2007


Hi Dimitris,

On Feb 22, 2007, at 10:27 AM, Dimitris Rizopoulos wrote:

> maybe cbind() is close to what you're looking for, e.g.,
>
> tb1 <- table(x, y)
> tb2 <- table(x, z)
>
> cbind(tb1, tb2)
>
Yes, that was my first thought too, and it does place the values  
where I want them, but it completely destroys the names, which I'd  
like to keep, i.e. it doesn't treat it as a table any more. The  
resulting LaTeX table I would like to have a very top row, with  
multicolumn titles, one for each factor, then a second row with the  
levels for each factor, and then below those the data. I could I  
guess add that stuff separately, but I was hoping someone had already  
done that part.
>
> Best,
> Dimitris

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College



More information about the R-help mailing list