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
steve <fisk <at> bowdoin.edu> writes:> > I would like to get rid of the row numbers using xtable and latex. > > 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? > > SteveSteve, ?print.xtable look at the include.rownames option. Greg
Sorry, meant for this to go to the whole list. On Mar 1, 2007, at 3:29 PM, Charilaos Skiadas wrote:> On Mar 1, 2007, at 2:52 PM, steve wrote: > >> Unfortunately, this applies to print.xtable, and not to latex. I >> want to >> know how to eliminate them using latex() > > 1) Why do you need to use latex() instead of print.xtable? > 2) If you want to use latex(), then why are you using xtable at > all, instead of latex(d) directly?Haris Skiadas Department of Mathematics and Computer Science Hanover College
>> Also, if x is a data frame, latex(x) contains the row numbers. >> Can I get rid of them here as well?I think you are asking for the rowname=NULL argument. latex(x, rowname=NULL) See ?latex to confirm if that is what you are looking for. Rich
Richard M. Heiberger wrote:>>> Also, if x is a data frame, latex(x) contains the row numbers. >>> Can I get rid of them here as well? > > > I think you are asking for the rowname=NULL argument. > latex(x, rowname=NULL) > See ?latex to confirm if that is what you are looking for. > > Rich > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >Yes - that is exactly what I wanted. thanks, Steve