A more primitive method is about 5 times faster than Gabor's.

L <- list(
            a = c("1", "2", "3"),
            b = c("1"),
            d = c("2", "4")
)

system.time(
for (i in 1:100)
{t1 <- unlist(L)
names(t1) <- rep(names(L), lapply(L, length))
tapply(names(t1), t1, c)
}
)

system.time(
for (i in 1:100)
unstack(stack(L)[2:1])
)

______________________________________________
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