Skip to content
Prev 200001 / 398502 Next

Rearranging long tables, Sweave, xtable, LaTeX

Yeah, I've had this kind of situation before. Usually I first see if I
can fit it on the page by rotating it and/or reducing the size. If
that doesn't do it then I'll re-arrange as you suggest. Basically the
print method is just wrapping the output after n columns (27 in my
case, but I think this depends on the options you have set). So you
can do this wrapping yourself before calling xtable:

tmp <- with(expand.grid(Fact1 = 1:3, Fact2 = 1:40), table(Fact1, Fact2))
tmp2 <- rbind(tmp[,1:20], tmp[,21:40])
xtable(tmp2)

Hope it helps,

Ista


On Thu, Nov 12, 2009 at 4:20 AM, Ottorino-Luca Pantani
<ottorino-luca.pantani at unifi.it> wrote: