[R] From R to LaTeX to pdf?

Kevin E. Thorpe kevin.thorpe at utoronto.ca
Tue Nov 24 15:10:53 CET 2009


Joel Fürstenberg-Hägg wrote:
> Hi all,
> 
>  
> 
> Anyone experienced in the LaTeX format?
> 
>  
> 
> I'm trying to use the xtable package to create nice anova tables, but how do I do to produce a pdf from the resulting LaTeX table? I've tried WinShell and MiKTeX, but I couldn't get any of them working...
> 
>  
> 
> Here's an example of the output in R:
> 
>  
> 
> % latex table generated in R 2.9.2 by xtable 1.5-6 package
> % Tue Nov 24 14:17:32 2009
> \begin{tabular}{lrrrrr}
>   \hline
>  & Df & Sum Sq & Mean Sq & F value & Pr($>$F) \\ 
>   \hline
> cat & 2 & 40.50 & 20.25 & 6.66 & 0.0019 \\ 
>   Residuals & 107 & 325.13 & 3.04 &  &  \\ 
>    \hline
> \end{tabular}

The output from xtable (above) is not a self-contained, complete
LaTeX file.  You need, at the very least, A \documentclass statement
at the beginning of the file and the code above needs to be inside a
\begin{document} ... \end{document} pair.

Then, the pdflatex (I beilieve this exists in MiKTeX) command builds
a pdf file.

Kevin

> 
>  
> 
> Best regards,
> 
>  
> 
> Joel


-- 
Kevin E. Thorpe
Biostatistician/Trialist, Knowledge Translation Program
Assistant Professor, Dalla Lana School of Public Health
University of Toronto
email: kevin.thorpe at utoronto.ca  Tel: 416.864.5776  Fax: 416.864.3016




More information about the R-help mailing list