[R] Mathematical typesetting of column heads using the latex (Hmisc) function

From: Michael Kubovy <kubovy_at_virginia.edu>
Date: Sun 12 Feb 2006 - 13:23:27 EST


Dear r-helpers,

I would very much appreciate help with the following problem:

The following command (in a .Rnw file)

latex(anova(e7.lmer3, e7.lmer4), file = 'e7lmer34.tex', rowname = c ('nonlinear', 'linear'), longtable = FALSE, dcolumn = T, booktabs = T, table.env = F)

produces the following output after running Sweave:

% latex.default(anova(e7.lmer1, e7.lmer2), file =

"e7lmer12.tex",      rowname = c("nonlinear", "linear"), longtable =  
FALSE, dcolumn = T,      booktabs = T, table.env = F)
%
\newcolumntype{.}{D{.}{.}{-1}}
\begin{center}
\begin{tabular}{l.......}\toprule
\multicolumn{1}{l}{anova}&
\multicolumn{1}{c}{Df}&
\multicolumn{1}{c}{AIC}&
\multicolumn{1}{c}{BIC}&
\multicolumn{1}{c}{logLik}&
\multicolumn{1}{c}{Chisq}&
\multicolumn{1}{c}{Chi Df}&
\multicolumn{1}{c}{Pr(>Chisq)}

<snip>

I would like it to produce

\newcolumntype{.}{D{.}{.}{-1}}
\begin{center}
\begin{tabular}{l.......}\toprule
&
\multicolumn{1}{c}{d.f.}&
\multicolumn{1}{c}{\textsc{aic}}&
\multicolumn{1}{c}{\textsc{bic}}&
\multicolumn{1}{c}{$\log{(\mathcal{L})}$}&
\multicolumn{1}{c}{$\chi^{2}$}&
\multicolumn{1}{c}{\chi^{2}$ d.f.}&
\multicolumn{1}{c}{Pr($> \chi^{2}$)}

<snip>



Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
         McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766

WWW: http://www.people.virginia.edu/~mk9y/

R-help@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 Received on Sun Feb 12 13:29:53 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:27 EST