Skip to content
Prev 77942 / 398502 Next

Using unsplit - unsplit does not seem to reverse the effect of split

S??ren H??jsgaard <Soren.Hojsgaard at agrsci.dk> writes:
It only works if the first argument is or could have resulted from a
split on the second argument. That is clearly not the case when you
are creating subvectors. 

I have on occasion wanted an unsplit that worked without the 2nd
argument as in

unsplit(l, rep(seq(along=l), sapply(l,length)) )

but if you think about it, it's not really doing anything that
do.call("c",l) or do.call("rbind",l) won't do.