RE: [Rd] Notes on bug reports 3229 and 3242 - as.matrix.data.fram e

From: Gorjanc Gregor <Gregor.Gorjanc_at_bfro.uni-lj.si>
Date: Sat 12 Feb 2005 - 07:36:48 EST


From: Liaw, Andy [mailto:andy_liaw@merck.com]
> From: Gorjanc Gregor

> ! Yes, I was not able to do it from my data. But bellow is one. It is
> ! a stupid one, but it works. The problem is use of as.data.frame in
> ! tmp1$L <- as.data.frame(tmp$L). This looks like to produce
> a corrupted
> ! data.frame. If I use just tmp1$L <- tmp$L, write.table and
> ! as.matrix.data.frame works OK. I still think that mine proposal can
> ! give benefit, since it works also on corrupted data frames.
>
> data(warpbreaks)
> tmp <- as.data.frame(tapply(breaks, list(wool, tension), mean))
> tmp1 <- data.frame(level=rownames(tmp))
> tmp1$L <- as.data.frame(tmp$L)

Here's the problem that Brian is referring to: Why do you make one variable in the data frame a data frame? That's what caused problem in write.table()!

! I agree completely and as I have described up it is my fault that
! I have/had problems with as.matrix.data.frame by use of write.table.
! But I think that my proposal is nice, since as.matrix.data.frame would 
! be more robust.

! With regards, Gregor



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat Feb 12 06:58:59 2005

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:02:51 EST