Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
How can I use a table generated by R in LaTeX?

I use a lot of tables from R, and I find it cumbersome and very slow to type the "&" and "\" etc. to get the tables translated into LaTeX. Is there some way to have a table like that below automatically formatted for LaTeX?

      Df Deviance Resid. Df Resid. Dev
NULL                      74    1233.55
inflat  1     4.13        73    1229.42
inc     1   907.24        72     322.18
Analysis of Deviance Table

       Df Deviance Resid. Df Resid. Dev
NULL                      59    1450.07
inflat  1    99.44        58    1350.63
inc     1   861.93        57     488.69
Analysis of Deviance Table

       Df Deviance Resid. Df Resid. Dev
NULL                     158    28963.3
inflat  1   3302.4       157    25660.9
inc     1  23996.2       156     1664.8
share|improve this question
10  
You can use the R xtable package to generate LaTeX directly from R. See How can I use a table generated by R in LaTeX –  Alan Munn Nov 14 '11 at 12:14
add comment

marked as duplicate by Seamus, Torbjørn T., Alan Munn, Joseph Wright Nov 16 '11 at 13:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

Using the XTable package as Alan commented. There's a good set of example tables as part of the CRAN XTable vignette. You may also want to look at the descr package which has helper function to produce some other usefull tables.

Xtable can either just produce the latex code that you can copy/paste into a tex file, or you can use it within a sweave document to produce the tables automatically as part of your analysis.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.