[BioC] Converting list to a matrix

Sean Davis sdavis2 at mail.nih.gov
Tue Apr 12 15:10:36 CEST 2011


On Tue, Apr 12, 2011 at 8:54 AM, pankaj borah
<pankajborah2k3 at yahoo.co.in> wrote:
> I have a list ( L) of 63 objects and each object has 30800 variables.
>
>>str (L)
>
> List of 63
>  $ objec1  : num [1:30300] 0.927 0.813 0.397 0.703 0.651 ...
>  $ object2  : num [1:30300] 0.636 0.447 0.738 0.648 0.62 ...
> .............
>  $ object63  : num [1:30380] 0.1123 0.2119 0.4078 0.0383 0.0641 ....
>
>
>
>
> I want to convert  the list L to a matrix M
>
> So it should be ---
>>str(M)
>
> num [1:30380, 1:63]
>  attr(*, "dimnames")=List of 2
>
>
> How do I do that ?

Try:

M = do.call('cbind',L)

Sean



More information about the Bioconductor mailing list