[R] List to Data Frame

Ko-Kang Kevin Wang kwan022 at stat.auckland.ac.nz
Fri Aug 23 03:35:11 CEST 2002


Hi,

Suppose I have two lists.  The first list is called FOO while the second
is called FRED.  

Say FOO looks (I've simplifed it) like:
    [[1]]
            [,1]
  [1,] 1
  [2,] 2

    [[2]]
            [,1]
  [1,] 3
  [2,] 4
while FRED looks like:
    [[1]]
            [,1]
  [1,] 5
  [2,] 6        

    [[2]]
            [,1]
  [1,] 7  
  [2,] 8

Can I turn this list into a dataframe which looks like:
             FOO  FRED 
  theta1.1     1     5
  theta2.1     2     6
  theta1.2     3     7
  theta2.2     4     8
or something close to this form?

In fact what I will have some 20 rows with something like: 
  theta1.1
  theta2.1
  theta1.2
  theta2.2
  theta1.3
  theta2.3
  .
  .
  .

However, I'm not sure how to achieve this.

Thanks in advance for the help  

Cheers,

Kevin

------------------------------------------------------------------------------
Ko-Kang Kevin Wang
Postgraduate PGDipSci Student
Department of Statistics
University of Auckland
New Zealand
Homepage: http://www.stat.auckland.ac.nz/~kwan022


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list