Hello, This is an urgent request. I want to convert a list of 3 elements into a matrix and I am not sure how to do it. The list looks like this: List of 3 $ : num [1:15364, 1] 0.133 0.622 0.588 1.024 0.583 ... ..- attr(*, "dimnames")=List of 2 .. ..$ : chr [1:15364] "6420681" "3610072" "2260458" "60689" ... .. ..$ : NULL $ : num [1:15364, 1] 3.159 0.265 0.522 1.912 3.380 ... ..- attr(*, "dimnames")=List of 2 .. ..$ : chr [1:15364] "6420681" "3610072" "2260458" "60689" ... .. ..$ : NULL $ : num [1:15364, 1] 3.214 0.277 1.447 1.827 2.054 ... ..- attr(*, "dimnames")=List of 2 .. ..$ : chr [1:15364] "6420681" "3610072" "2260458" "60689" ... .. ..$ : NULL I want to convert it to a matrix like this: ID 1 2 3 6420681 0.1332478 3.15862 3.214367 3610072 0.6219358 0.265226 0.276525 2260458 0.5876415 0.522378 1.44687 60689 1.0240852 1.911613 1.827464 Thanks Manisha [[alternative HTML version deleted]]
On Sun, 2009-06-07 at 00:14 -0400, Manisha Brahmachary wrote:> Hello, > > > > This is an urgent request. I want to convert a list of 3 elements into a > matrix and I am not sure how to do it. > > > > The list looks like this: > > List of 3 > > $ : num [1:15364, 1] 0.133 0.622 0.588 1.024 0.583 ... > > ..- attr(*, "dimnames")=List of 2 > > .. ..$ : chr [1:15364] "6420681" "3610072" "2260458" "60689" ... > > .. ..$ : NULL > > $ : num [1:15364, 1] 3.159 0.265 0.522 1.912 3.380 ... > > ..- attr(*, "dimnames")=List of 2 > > .. ..$ : chr [1:15364] "6420681" "3610072" "2260458" "60689" ... > > .. ..$ : NULL > > $ : num [1:15364, 1] 3.214 0.277 1.447 1.827 2.054 ... > > ..- attr(*, "dimnames")=List of 2 > > .. ..$ : chr [1:15364] "6420681" "3610072" "2260458" "60689" ... > > .. ..$ : NULLI'm not sure if understood your question, but look this code a<-list(B=1:3,C=2:4,D=3:5) matrix(unlist(a),ncol=3) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil
Seemingly Similar Threads
- How to use a text box instead a lis for year in date_select
- RE: drag and drop sorting with an empty lis
- [ANNOUNCE] pixman release 0.11.2 now available
- DO NOT REPLY [Bug 5246] New: rsync fails to transfer some files
- [Bug 15233] New: geforce 7800gs and AGP 3.0 DBI function