http://cran.r-project.org/web/packages/xtable/vignettes/xtableGallery.pdf I am trying to learn how to make a Latex table using R from the link above. However, instead of a Latex table as showed in the link, the R codes from the link generate actual Latex codes as follows: % latex table generated in R 3.1.0 by xtable 1.7-3 package % Thu May 15 09:21:18 2014 \begin{tabular}{rrlllr} \hline & grade & sex & disadvg & ethnicty & tlimth \\ \hline 1 & 6 & M & YES & HISPANIC & 43 \\ 2 & 7 & M & NO & BLACK & 88 \\ 3 & 5 & F & YES & HISPANIC & 34 \\ 4 & 3 & M & YES & HISPANIC & 65 \\ 5 & 8 & M & YES & WHITE & 75 \\ 6 & 5 & M & NO & BLACK & 74 \\ 7 & 8 & F & YES & HISPANIC & 72 \\ 8 & 4 & M & YES & BLACK & 79 \\ 9 & 6 & M & NO & WHITE & 88 \\ 10 & 7 & M & YES & HISPANIC & 87 \\ \hline \end{tabular} I have TeX Live 2013 installed in my computer. It doesn't help, either. Should I need some kind of connection (software or codes) between R and Latex? Thanks. Hongsheng (Hank) Liao, PhD. Lab Manager Center for Quantitative Fisheries Ecology Old Dominion University 757-683-4571 [[alternative HTML version deleted]]
Hi Liao, I think that the purpose of the package is actually to create the latex code to insert into Latex documents. If you want to see it displayed you have to compile it with latex; the document you have sent says that that is a gallery to show the different kind of tables you can create. 2014-05-15 15:46 GMT+02:00 Liao, Hongsheng <HLiao at odu.edu>:> http://cran.r-project.org/web/packages/xtable/vignettes/xtableGallery.pdf > > I am trying to learn how to make a Latex table using R from the link above. However, instead of a Latex table as showed in the link, the R codes from the link generate actual Latex codes as follows: > > % latex table generated in R 3.1.0 by xtable 1.7-3 package > % Thu May 15 09:21:18 2014 > \begin{tabular}{rrlllr} > \hline > & grade & sex & disadvg & ethnicty & tlimth \\ > \hline > 1 & 6 & M & YES & HISPANIC & 43 \\ > 2 & 7 & M & NO & BLACK & 88 \\ > 3 & 5 & F & YES & HISPANIC & 34 \\ > 4 & 3 & M & YES & HISPANIC & 65 \\ > 5 & 8 & M & YES & WHITE & 75 \\ > 6 & 5 & M & NO & BLACK & 74 \\ > 7 & 8 & F & YES & HISPANIC & 72 \\ > 8 & 4 & M & YES & BLACK & 79 \\ > 9 & 6 & M & NO & WHITE & 88 \\ > 10 & 7 & M & YES & HISPANIC & 87 \\ > \hline > \end{tabular} > > I have TeX Live 2013 installed in my computer. It doesn't help, either. Should I need some kind of connection (software or codes) between R and Latex? Thanks. > > > Hongsheng (Hank) Liao, PhD. > Lab Manager > Center for Quantitative Fisheries Ecology > Old Dominion University > 757-683-4571 > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org 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.
On 15/05/2014 9:46 AM, Liao, Hongsheng wrote:> http://cran.r-project.org/web/packages/xtable/vignettes/xtableGallery.pdf > > I am trying to learn how to make a Latex table using R from the link above. However, instead of a Latex table as showed in the link, the R codes from the link generate actual Latex codes as follows: > > % latex table generated in R 3.1.0 by xtable 1.7-3 package > % Thu May 15 09:21:18 2014 > \begin{tabular}{rrlllr} > \hline > & grade & sex & disadvg & ethnicty & tlimth \\ > \hline > 1 & 6 & M & YES & HISPANIC & 43 \\ > 2 & 7 & M & NO & BLACK & 88 \\ > 3 & 5 & F & YES & HISPANIC & 34 \\ > 4 & 3 & M & YES & HISPANIC & 65 \\ > 5 & 8 & M & YES & WHITE & 75 \\ > 6 & 5 & M & NO & BLACK & 74 \\ > 7 & 8 & F & YES & HISPANIC & 72 \\ > 8 & 4 & M & YES & BLACK & 79 \\ > 9 & 6 & M & NO & WHITE & 88 \\ > 10 & 7 & M & YES & HISPANIC & 87 \\ > \hline > \end{tabular} > > I have TeX Live 2013 installed in my computer. It doesn't help, either. Should I need some kind of connection (software or codes) between R and Latex? Thanks.The xtable package produces LaTeX code to insert into a LaTeX document. You need to cut and paste it into your document, or use Sweave or knitr to insert it automatically. A minimal LaTeX document might look like this: \documentclass{article} \begin{document} Insert the code here \end{document} You would save that in a file with a file extension .tex, and run latex or pdflatex on it. To do the latter you can run those programs from the command line, or from varous editors, e.g. TeXWorks. Duncan Murdoch
stargazer is the best. http://cran.r-project.org/web/packages/stargazer/stargazer.pdf <http://cran.r-project.org/web/packages/stargazer/stargazer.pdf> heres an example code: stargazer(women_con_mod, women_con_mod, se = list(WCM_naive.std.err,WCM_rob.std.err), title="Regression Results", align=TRUE, dep.var.labels=c("Political Participation"), covariate.labels=c("Religiosity * Conservative","Religiosity", "Education","Black","Hispanic","Family Income", "Volunteer Associations", "Age"), no.space=TRUE, omit.stat=c("LL","ser","f", "rsq"), column.labels=c("Naive SE", "Robust SE"), dep.var.caption="", model.numbers=FALSE) Above, I am just comparing one regression to the same regression with robust standard errors. Its beautiful, works perfectly by copy-paste in Latexian, at the very least. -- View this message in context: http://r.789695.n4.nabble.com/How-to-make-a-Latex-table-using-R-tp4690647p4690676.html Sent from the R help mailing list archive at Nabble.com.