[R] convert list of lists to simple list

Philippe Grosjean phgrosjean at sciviews.org
Thu Oct 10 13:37:11 CEST 2013


On 10 Oct 2013, at 13:17, ivan <i.petzev at gmail.com> wrote:

> test <- foreach(i = 1:3) %:%
>              foreach (j = 1:3) %do% {
>                 paste(i,j,sep=",")
>              }

Not easily reproducible, unless you write

#install.packages("foreach")
require(foreach)

in front of your code.

Here is a starting point:

unlist(test, recursive = FALSE)

… but you would probably need to build a recursive call of the function down to the last 'list level'. unlist(recursive = TRUE) goes one level too far.
Best,

Philippe Grosjean


More information about the R-help mailing list