[R] write a table to file with unequal length of lists

Zhu Wang zwang at scharp.org
Fri Sep 1 22:29:01 CEST 2006

Dear R helpers,

To illustrate my problem, here is a simplified example. I want to write 
a table to a file similar to:
x                      a
1                      4,5
2                      8,9,10

Note the length of elements of "a" is 2 and 3 respectively.  This can be 
created by, for example,
x <- c(1,2)
a <- NULL
a[1] <- list(c(4,5))
a[2] <- list(c(8,9,10)

Any suggestions to write such a table to file would be appreciated.


Zhu Wang

More information about the R-help mailing list