Skip to content
Prev 268804 / 398503 Next

getting names of dimnames of xtabs into xtable latex output

Hi

Will this fix the problem?

str(table2)
xtable(data.frame(table2))
% latex table generated in R 2.13.1 by xtable 1.5-6 package
% Wed Aug 17 13:02:38 2011
\begin{table}[ht]
\begin{center}
\begin{tabular}{rllr}
   \hline
  & change\_diet & mydiet & Freq \\
   \hline
1 & Don't know & 0 & 26.00 \\
   2 & Somewhat likely & 0 & 0.00 \\
   3 & Somewhat unlikely & 0 & 40.00 \\
   4 & Very likely & 0 & 0.00 \\
   5 & Very unlikely & 0 & 10.00 \\
   6 & Don't know & 1 & 0.00 \\
   7 & Somewhat likely & 1 & 188.00 \\
   8 & Somewhat unlikely & 1 & 0.00 \\
   9 & Very likely & 1 & 281.00 \\
   10 & Very unlikely & 1 & 0.00 \\
    \hline
\end{tabular}
\end{center}
\end{table}

Regards

Duncan


Duncan Mackay
Department of Agronomy and Soil Science
University of New England
ARMIDALE NSW 2351
Email: home mackay at northnet.com.au
At 02:03 17/08/2011, you wrote: