[R] Xtable giving an interesting problem
Prof Brian Ripley
ripley at stats.ox.ac.uk
Mon Jun 7 15:30:05 CEST 2004
Did you try dump.frames/debugger? Or even traceback()?
> debugger()
Message: Error in match.names(clabs, names(xi)) : names don't match
previous names:
F value, Pr(>F)
Available environments had calls:
1: xtable(fit.trans.aov)
2: xtable.aovlist(fit.trans.aov)
3: xtable.summary.aovlist(summary(x), caption = caption, label = label,
align = ali
4: rbind(result, xtable.anova(x[[i]][[1]], caption = caption, label =
label, align
5: rbind(...)
6: match.names(clabs, names(xi))
7: stop(paste("names don't match previous names:\n\t", paste(nmi[nii == 0], collaps
and if you look in xtable.summary.aovlist you will see it is trying to
rbind a dataframe with 5 columns to one with three columns. That's not
surprising given the print output for summary(fit.trans.aov) and is a
design error in the xtable package that should be reported to the
maintainer.
However, is this model really `interesting'? I cannot see what you hoped
to learn by fitting it.
On Mon, 7 Jun 2004, Shawn Way wrote:
> I'm using the current version of xtable for 1.9.0 and I have an
> interesting error:
>
> Error in match.names(clabs, names(xi)) : names don't match previous
> names:
> F value, Pr(>F)
> In addition: Warning message:
> longer object length
> is not a multiple of shorter object length in: clabs == nmi
>
> This is produced in the following manner:
>
> >data.trans <- data.frame(ref=rep(c(3.995,20.003),2),
> actual=c(.1,100.3,.1,100.3),
> level=gl(2,1))
>
> >parameters <- data.frame(trans.range=c(0,100), trans.output=c(4,20),
> ref.error=c(.0074))
> >a <- lm(trans.range~trans.output,data=parameters)
> >pred <- data.frame(trans.output=data.trans$actual)
> >data.trans$cor <- predict(a,pred)
> >fit.trans <- lm(cor~ref,data.trans)
> >fit.trans.aov <- aov(cor~ref+Error(level),data.trans)
> >fit.trans
>
> Call:
> lm(formula = cor ~ ref, data = data.trans)
>
> Coefficients:
> (Intercept) ref
> -180.66 39.12
>
> > fit.trans.aov
>
> Call:
> aov(formula = cor ~ ref + Error(level), data = data.trans)
>
> Grand Mean: 288.75
>
> Stratum 1: level
>
> Terms:
> ref
> Sum of Squares 392189.1
> Deg. of Freedom 1
>
> Estimated effects are balanced
>
> Stratum 2: Within
>
> Terms:
> Residuals
> Sum of Squares 1.074245e-27
> Deg. of Freedom 2
>
> Residual standard error: 2.317591e-14
> > summary(fit.trans.aov)
>
> Error: level
> Df Sum Sq Mean Sq
> ref 1 392189 392189
>
> Error: Within
> Df Sum Sq Mean Sq F value Pr(>F)
> Residuals 2 1.0742e-27 5.3712e-28
> > library(xtable)
> > xtable(fit.trans.aov)
> Error in match.names(clabs, names(xi)) : names don't match previous
> names:
> F value, Pr(>F)
> In addition: Warning message:
> longer object length
> is not a multiple of shorter object length in: clabs == nmi
>
>
> Any ideas?
>
>
> "Everything should made as simple as possible, but not simpler."
> -Albert Einstein
>
>
> Shawn Way, PE
> Tanox, Inc.
> 10301 Stella Link
> Houston, TX 77025
> Engineering Manager
> Sway[at]tanox.com
>
>
>
> Note: Any use, dissemination, forwarding, printing or copying of this
> e-mail without consent of Tanox, Inc. is not authorized. Further, this
> communication may contain confidential information intended only for the
> person to whom it is addressed, and any use, dissemination, forwarding,
> printing or copying of such confidential information without the express
> consent of Tanox or in violation of any agreements to which the
> recipient is subject is prohibited. If you have received this e-mail in
> error, please immediately notify the sender and delete the original and
> all copies. Any views or opinions expressed may be solely those of the
> author and do not necessarily represent the views or opinions of Tanox,
> Inc.
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list