Skip to content
Prev 26116 / 398502 Next

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

In R, it looks like the "summary.aov" type actually contains the data 
frame you're trying to extract as the first (and only) element of a list, 
so 

summary(aov(model))[[1]]

is more or less equivalent to the summary(aov(model)) object in S-PLUS, 
and

summary(aov(model))[[1]]$"Pr(>F)"[1]

gets the specific number you're looking for.

str()  and class() are the tools for disentangling this kind of problem.  
It is a shame that it's so hard to extract the value in this case, but the
authors have to be able to structure things internally however they find
convenient, and unless they provide accessor methods for everything anyone 
could conceivably want, people are going to have to dig at some point ...
On Mon, 9 Dec 2002, RexBryan wrote: