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])
)