[R] Exporting a list of lists

rkevinburton at charter.net rkevinburton at charter.net
Mon Aug 11 22:14:45 CEST 2008


I have a list

List(Sku=" ", Shape=1, Scale=3, DayOfYear=daylist)
Note: picture daylist as c(2,3,4,3) it is a list with variable length.

Then I have a list of lists

al <- c(al, List(List(Sku=" ", Shape=1, Scale=3, DayOfYear=daylist))
Note: same comment on daylist as above.

So far this creates a list of lists just how I want it. If I do al[1] I get each member and the variable length list 'daylist'.

Now I want to export this list of lists:

write.table(mlist, "SkuInfo.dat", row.names = FALSE,  sep=",")

But I get an error that the list lengths are not equal. The only member of this list that has a variable length would be DayOfYear

How can I output this list of lists when each element list contains a variable length list?

Thank you.

Kevin



More information about the R-help mailing list