[R] How to extract part of an array?
Peter Dalgaard
P.Dalgaard at biostat.ku.dk
Wed Sep 5 11:35:16 CEST 2007
Lauri Nikkinen wrote:
> Hi,
>
> How can I extract part of an array? I would like to extract table
> Supported from this array. If this is not possible, how do I convert
> array to list? I'm sorry this is not an reproducible example.
>
>
>> spl <- tapply(temp$var1, list(temp$var2, temp$var3, temp$var3), mean)
>> spl
>>
> , , Supported
>
> 07 08
> A 68.38710 71.48387
> B 21.67742 20.83871
> C 55.74194 61.12903
> AL L 26.19816 27.39631
>
> , , Not_supported
>
> 07 08
> A NA 82.38710
> B NA 24.00000
> C NA 68.77419
> ALL NA 29.97984
>
>
How about spl[,,"Supported"]?
-p
--
O__ ---- Peter Dalgaard Øster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help
mailing list