[R] odfWeave and xtable

Max Kuhn mxkuhn at gmail.com
Sat Jan 12 21:09:09 CET 2008


One thing on my (neglected) to-do list for odfWeave is to create a
general class called odf that can be used to create output for common
models (lm, glm etc). The nice thing here is that the output from this
function could write mixed output. For example, a short paragraph
about the specified model, the table for coefficients produced by
summary.lm, diagnostic plots etc.

Right now, to get the coeffcient table use:

  #from ?lm
  ## Annette Dobson (1990) "An Introduction to Generalized Linear Models".
  ## Page 9: Plant Weight Data.
  ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
  trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
  group <- gl(2,10,20, labels=c("Ctl","Trt"))
  weight <- c(ctl, trt)
  lm.D9 <- lm(weight ~ group)

  library(odfWeave)
  coefTable <- summary(lm.D9)$coef
  colnames(coefTable) <- odfTranslate(colnames(coefTable), toR = FALSE)
  odfTable(coefTable)

Max

On Jan 12, 2008 1:03 PM, Frank E Harrell Jr <f.harrell at vanderbilt.edu> wrote:
> ??? wrote:
> > Dear All,
> >
> > I am new to odfWeave and was wondering if there are something similar
> > to the xtable package that can automatically convert model
> > coefficients into LaTeX/ODT tables?  More generally, how do people who
> > use odfWeave transform model results into tables? The odfTable does
> > not seem to be able to do this (maybe I am wrong, and would appreciate
> > some demos). Thanks.
> >
> > Best,
> > Shige
>
> This is not related to tables, but see the latex methods in the Design
> package.  There are methods for using LaTeX to typeset various kinds of
> regression model fits.
>

-- 

Max




More information about the R-help mailing list