Bill Shipley <Bill.Shipley at Usherbrooke.ca> writes:> Hello. When one types "summary(fit)", where fit is an object from a > call to aov(), one gets an ANOVA table. I want to save just one > element of this summary. How does one extract this? > > As an example, here is my output from a split plot ANOVA: > > > summary(out)$"Error: soil.cores$block:soil.cores$treatment" > Df Sum Sq Mean Sq F value Pr(>F) > soil.cores$block 3 0.63626 0.21209 1.0557 0.4147 > soil.cores$treatment 3 0.90276 0.30092 1.4978 0.2802 > Residuals 9 1.80813 0.20090 > > I want to save only the F value of "soil.cores$treatment" . In SPLUS > one would do this by > summary(out)$"Error: soil.cores$block:soil.cores$treatment"$"F > value"[2] but this doesn't seem to work.R seems to require an extra [[1]] bit before $"F value". Don't ask me why... -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hello. When one types "summary(fit)", where fit is an object from a call to aov(), one gets an ANOVA table. I want to save just one element of this summary. How does one extract this? As an example, here is my output from a split plot ANOVA: > summary(out)$"Error: soil.cores$block:soil.cores$treatment" Df Sum Sq Mean Sq F value Pr(>F) soil.cores$block 3 0.63626 0.21209 1.0557 0.4147 soil.cores$treatment 3 0.90276 0.30092 1.4978 0.2802 Residuals 9 1.80813 0.20090 I want to save only the F value of "soil.cores$treatment" . In SPLUS one would do this by summary(out)$"Error: soil.cores$block:soil.cores$treatment"$"F value"[2] but this doesn't seem to work. Thanks. Bill Shipley Departement de biologie Universite de Sherbrooke Sherbrooke (Quebec) CANADA J1K 2R9 Bill.Shipley at USherbrooke.ca http://callisto.si.usherb.ca:8080/bshipley/ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 24 Sep 2002, Bill Shipley wrote:> Hello. When one types "summary(fit)", where fit is an object from a call > to aov(), one gets an ANOVA table. I want to save just one element of this > summary. How does one extract this? > > As an example, here is my output from a split plot ANOVA: > > > summary(out)$"Error: soil.cores$block:soil.cores$treatment" > Df Sum Sq Mean Sq F value Pr(>F) > soil.cores$block 3 0.63626 0.21209 1.0557 0.4147 > soil.cores$treatment 3 0.90276 0.30092 1.4978 0.2802 > Residuals 9 1.80813 0.20090 > > I want to save only the F value of "soil.cores$treatment" . In SPLUS one > would do this by > summary(out)$"Error: soil.cores$block:soil.cores$treatment"$"F value"[2] > but this doesn't seem to work. >It turns out that summary(out)$"Error: soil.cores$block:soil.cores$treatment" is actually a list containing one data frame rather than a data frame, so something like aovtable<-summary(out)$"Error: soil.cores$block:soil.cores$treatment"[[1]] aovtable[2,"F value"] would work. -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Is there a simple way to string-concatenate across the rows of a matrix or data.frame into a vector of strings? perhaps using paste() or something like it? That is, I want to map from something like x2 below: > x2 <- data.frame(C1 = letters[1:4], C3=1:4, C3=letters[11:14]) > x2 C1 C3 C3 1 a 1 k 2 b 2 l 3 c 3 m 4 d 4 n to something like: [1] "a 1 k" [2] "b 2 l" [3] "c 3 m" [4] "d 4 n" Sincerely, Al Kim Research Scientist Department of Psychology University of Washington, Box 351525 Seattle, WA. 98195, USA E-Mail: alkim at u.washington.edu; Tel: (206)543-2395 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> apply(format(x2), 1, paste, collapse=" ")1 2 3 4 "a 1 k" "b 2 l" "c 3 m" "d 4 n" At 12:45 PM 9/24/2002 -0700, Albert Kim wrote:>Is there a simple way to string-concatenate across the rows of a matrix or >data.frame into a vector of strings? perhaps using paste() or >something like it? > >That is, I want to map from something like x2 below: > > > x2 <- data.frame(C1 = letters[1:4], C3=1:4, C3=letters[11:14]) > > x2 > C1 C3 C3 > 1 a 1 k > 2 b 2 l > 3 c 3 m > 4 d 4 n > >to something like: > > [1] "a 1 k" > [2] "b 2 l" > [3] "c 3 m" > [4] "d 4 n" > >Sincerely, >Al Kim >Research Scientist >Department of Psychology >University of Washington, Box 351525 >Seattle, WA. 98195, USA >E-Mail: alkim at u.washington.edu; Tel: (206)543-2395 > > > >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- >r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html >Send "info", "help", or "[un]subscribe" >(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch >_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Maybe Matching Threads
- Samba 3.0.3 on FC2: windows machine cannot join domain
- extracting RGB values from a colorspace class object
- Re: Samba 3.0.3 on FC2: windows machine cannot join domain
- Adonis and nmds help and questions for a novice.
- akima interpolation and triangulation question