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

RexBryan rexbryan1 at attbi.com
Mon Dec 9 19:48:02 CET 2002


R-wizards

I have successfully run with S+ a statistical power calculation for
non-normal distributions as presented in M. Crawley’s new book.  When I
tried the newest version of R on the same code, the $ parse statement
doesn't seem to retrieve the appropriate number from a table. Note that
some of the cosmetic differences in the two tables have to be dealt with
by the parser. Any ideas what's happening?
REX

# Begin R -------------------------------------------------------------
#
> summary(aov(model))
 
             	Df 	Sum Sq 	Mean Sq 	F value 	Pr(>F)
fa            	1   	11.1    	11.1  	0.9327 	0.3345
Residuals   	698 	8279.3    	11.9

# R: ... trying to parse the table gives a NULL for the probability of
F... 

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

# End R ---------------------------------------------------------------

# Begin S+ ------------------------------------------------------------

> summary(aov(model))

           		Df 	Sum of Sq  	Mean Sq   	F Value
Pr(F) 
fa   			1    	11.063 	11.06286 	0.9326708
0.3345044
Residuals 		698  	8279.314 	11.86148          

# S+ ... using $ to parse the table gives the right answer for the
probability of F...

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

# End S+ --------------------------------------------------------------




More information about the R-help mailing list