Well here is one more brain-teaser related to assigning stuff into a list of list. What if I need to create a new list of empty lists? I have actually got a solution to this problem:

    l = list(list())
    for ( i in sequence(length-1) )
    {
        l = list(unlist(l,recursive=FALSE), list())
    }

But it is not very neat to do this in a loop. Are there any cuter ways to do this?

Best,
Magnus

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to