[R] latex styling for R regression outputs
Paul Hiemstra
p.hiemstra at geo.uu.nl
Thu Jul 3 11:46:15 CEST 2008
Hi Matthias,
You can use the R-package Sweave to mix latex and R code. The Sweave
manual gives a good introduction on how to use the package.
If you just want to create a table for use in latex you could consider
using the xtable package. A small example:
> xtable(aov(lm(speed~dist, cars)))
% latex table generated in R 2.7.1 by xtable 1.5-2 package
% Thu Jul 3 11:44:34 2008
\begin{table}[ht]
\begin{center}
\begin{tabular}{lrrrrr}
\hline
& Df & Sum Sq & Mean Sq & F value & Pr($>$F) \\
\hline
dist & 1 & 891.98 & 891.98 & 89.57 & 0.0000 \\
Residuals & 48 & 478.02 & 9.96 & & \\
\hline
\end{tabular}
\end{center}
\end{table}
cheers and hth,
Paul
Matthias Bannert wrote:
> Hi everybody,
>
> i recently found the latex() command in the Hmisc library and i am
> trying to style some regression outputs with latex. i am pretty new to
> latex and math mode. So I wonder if there´s some sample script for a
> basic output. I read lots of econometrics books and regression outputs
> looked the same all the way. I mean there must be the one simple
> styling that is been used so often.
>
> I´d be really happy if someone could tell me a starting point for
> beginning to use R and latex together.
>
> thanks in advance
> --
>
> ______________________
> Es schreibt Ihnen:
>
> Matthias Bannert
> ---
> mediabar
>
> ______________________________________________
> 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.
--
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone: +31302535773
Fax: +31302531145
http://intamap.geo.uu.nl/~paul
More information about the R-help
mailing list