[R] how to get the value of aov summary into another variable
PAlspach at hortresearch.co.nz
Wed Oct 29 02:00:45 CET 2008
In general, examine the structure of the object and go from there.
will reveal that summary(aov.ex) is a list of 1. Thus you probably want
to examine that single element in more detail:
str(summary(aov.ex)[]) # the [] to get the first element of the
This is a data.frame, and hence:
will give what you want. You can, of course, assign this to another
object if you like. Incidentally, anova(aov.ex)[,4:5] is somewhat more
> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of Waverley
> Sent: Wednesday, 29 October 2008 1:49 p.m.
> To: r-help at r-project.org; r-help
> Subject: [R] how to get the value of aov summary into another variable
> I have a question of aov. e.g.
> aov.ex = aov(x~y)
> The aov summary will print to the screen. How can I extract
> the aov result, in particular the values of Pr(>F) and F
> value into a vector so that I can use them for other use?
> Waverley @ Palo Alto
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
The contents of this e-mail are privileged and/or confidential to the named
recipient and are not to be used by any other person and/or organisation.
If you have received this e-mail in error, please notify the sender and delete
all material pertaining to this e-mail.
More information about the R-help