Re: [R] xtable: custom row.names, move caption to top

2013-11-27 Thread Rainer Schuermann
You get the cation to the top of the table with print( saxtab, caption.placement = top ) Formatting the table the way you want can be done like this - I did not manage to carry the LaTeX math formatting for the row names over ($k$ and $n_k$)but the rest should be very much what you want:

Re: [R] xtable: custom row.names, move caption to top

2013-11-27 Thread Rainer Schuermann
UPDATE: Now including the LaTeX math formatting saxtab - t( as.data.frame( addmargins( Saxony ) ) ) rownames( saxtab ) - c( Males ($k$), Families ($n_k$) ) saxtab - xtable( saxtab, digits = 0, caption = Number of male children in 6115 Saxony families of size 12, align = l|rr

Re: [R] xtable: custom row.names, move caption to top

2013-11-27 Thread Michael Friendly
Thanks so much, Rainer. Your detailed example has taught me a lot of what I need to use xtable more productively, in particular the options for the print() method. -Michael On 11/27/2013 12:20 PM, Rainer Schuermann wrote: UPDATE: Now including the LaTeX math formatting saxtab - t(