[R] select elements and transpose

Henrique Dallazuanna wwwhsd at gmail.com
Wed Dec 30 17:27:09 CET 2009


If I understand, you can try this:

array(do.call(rbind, xx), c(3, 3, 3))


On Wed, Dec 30, 2009 at 11:45 AM, Muhammad Rahiz
<muhammad.rahiz at ouce.ox.ac.uk> wrote:
> Hi all,
>
> Given the following,
>
>> xx
> [[1]]
>    V1 V2 V3
> [1,]  1  2  3
> [2,]  4  5  6
> [3,]  7  8  9
> [[2]]
>    V1 V2 V3
> [1,]10 11  12
> [2,]13 14  15
> [3,]16 17  18
>
> [[3]]
>    V1 V2 V3
> [1,]19 20  21
> [2,]22 23  24
> [3,]25 26  27
>
> how do i extract elements in each file so that after transpose, it looks
> something like the following;
>
> 1
> 10
> 19
>
> 2
> 11
> 20
>
> 3
> 12
> 21
>
> and so on..
>
> Thanks..
>
>
>
> --
> Muhammad Rahiz  |  Doctoral Student in Regional Climate Modeling
>
> Climate Research Laboratory, School of Geography & the Environment
> Oxford University Centre for the Environment
> South Parks Road, Oxford, OX1 3QY, United Kingdom Tel: +44 (0)1865-285194
>  Mobile: +44 (0)7854-625974
> Email: muhammad.rahiz at ouce.ox.ac.uk
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O




More information about the R-help mailing list