[R] where did the factor name go

Richard M. Heiberger rmh at temple.edu
Tue May 29 01:05:08 CEST 2007


> tmp <- data.frame(y=rnorm(12), a=factor(rep(letters[1:4],3)))
> tmp
             y a
1  -0.60866099 a
2   0.55500538 b
3   0.12231693 c
4  -0.24613790 d
5  -0.09253593 a
6  -1.54652581 b
7   0.17204210 c
8  -1.22778942 d
9   1.22151194 a
10 -0.43982577 b
11 -1.25444287 c
12 -0.97251060 d
> tmp.aov <- aov(y ~ a, data=tmp)
> summary(tmp.aov)
            Df Sum Sq Mean Sq F value Pr(>F)
a            3 1.5220  0.5073  0.6973 0.5794
Residuals    8 5.8209  0.7276               
> dump("tmp.aov")
> rm(tmp.aov)
> source("dumpdata.R")
> ls()
[1] "tmp"     "tmp.aov"
> summary(tmp.aov)
            Df Sum Sq Mean Sq F value Pr(>F)
NA           3 1.5220  0.5073  0.6973 0.5794
Residuals    8 5.8209  0.7276               
> 


The factor name in the summary() after dumping and sourcing the
aov object is missing.


> version
               _                           
platform       i386-pc-mingw32             
arch           i386                        
os             mingw32                     
system         i386, mingw32               
status                                     
major          2                           
minor          5.0                         
year           2007                        
month          04                          
day            23                          
svn rev        41293                       
language       R                           
version.string R version 2.5.0 (2007-04-23)
>



More information about the R-help mailing list