[R] Str info. Thanks for helping
Ivan Calandra
ivan.calandra at uni-hamburg.de
Wed May 4 22:38:03 CEST 2011
It looks from str(SA) that Response IPS1 is a data.frame of class "anova", which probably cannot be coerced to vector.
Maybe you can use unlist() instead of as.vector()
Or something like
SA[["Response IPS1"]]["as.factor(WSD)",] ## to select the first row only, even maybe with unlist()
Without a better REPRODUCIBLE example, I cannot tell more (maybe some others can, that's why I reply to the list)
HTH,
Ivan
Le 4 mai 2011 à 20:17, reith_william at bah.com a écrit :
> I am still waiting for this to get posted so I thought I would email it to you.
>
> SA gives the output:
>
> Response IPS1 :
> Df Sum Sq Mean Sq F value Pr(>F)
> as.factor(WSD) 3 3.3136 1.10455 23.047 5.19e-12 ***
> Residuals 129 6.1823 0.04793
> ---
> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> .
> .
> .
> There are 11 more just like this output. Just increment IPS1 to IPS2, etc.
>
>
> Goal: save "3 3.3136 1.10455 23.047 5.19e-12" as a vector.
>
>
> Str(SA) gives the output:
>
> str(SA)
>> str(SA)
> List of 12
> " $ Response IPS1 :Classes 'anova' and 'data.frame': 2 obs. of 5 variables:"
> ..$ Df : num [1:2] 3 129
> ..$ Sum Sq : num [1:2] 3.31 6.18
> ..$ Mean Sq: num [1:2] 1.1045 0.0479
> ..$ F value: num [1:2] 23 NA
> ..$ Pr(>F) : num [1:2] 5.19e-12 NA
>
>
> There are several more but they are just repeats of this one only with IPS2, IPS3,...
>
> The command:
>
>> SA1<-as.vector(SA$"Reponse IPS1")
>
> Returns
>
>> NULL
>
> As do several variations I have tried. Any ideas.
--
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Institut und Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
ivan.calandra at uni-hamburg.de
**********
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/1525_8_1.php
More information about the R-help
mailing list