[R] Problem with differences between S+ and R in parsing output tables with $

Douglas Bates bates at stat.wisc.edu
Mon Dec 9 20:56:03 CET 2002


Ben Bolker <ben at zoo.ufl.edu> writes:

> On 9 Dec 2002, Douglas Bates wrote:
> 
> > Hmm - that's a peculiar way of trying to extract the information but
> > if you really want to do it like that you should first use str() to
> > determine the structure of the returned value.  It turns out that the
> > value is a list and the first component of the list is a data frame
> > with one column labelled "Pr(>F)".
> > 
> 
>   How would you normally go about extracting such information?  Other than 
> doing it via summary(model(aov))[[1]]$"Pr(>F)"[1] [which is admittedly 
> pretty horrible], or extracting the raw information from the aov object 
> and computing the F-prob oneself, I can't see how to do it ...

I think this means I should learn not to make editorial comments and
just stick to the answer.  On reflection I think you are correct in
what you said in your earlier posting.  This is not a particularly
elegant way of getting the p-value but it seems to be the only way of
doing so.  There is no accessor method for it.  Having an accessor
would be a more elegant design.




More information about the R-help mailing list