[R] question about xtable and Hmisc

steve fisk at bowdoin.edu
Thu Mar 1 15:31:35 CET 2007


I would like to get rid of the row numbers using xtable and latex.
The commands

  d = cbind(1:10,rep(1:2,5))
  ans = xtable(d)
  latex(ans)

gives output containing

\begin{tabular}{rrr}
   \hline
  & 1 & 2 \\
   \hline
1 & 1.00 & 1.00 \\
   2 & 2.00 & 2.00 \\
   3 & 3.00 & 1.00 \\
   4 & 4.00 & 2.00 \\
   5 & 5.00 & 1.00 \\
   6 & 6.00 & 2.00 \\
   7 & 7.00 & 1.00 \\
   8 & 8.00 & 2.00 \\
   9 & 9.00 & 1.00 \\
   10 & 10.00 & 2.00 \\
    \hline
\end{tabular}

but I don't want the row numbers. Is it possible to get rid of them?


Also, if x is a data frame, latex(x) contains the row numbers.
Can I get rid of them here as well?

Steve



More information about the R-help mailing list