Skip to content
Prev 201460 / 398506 Next

Split column

Try this:

cbind(x$id, t(do.call(rbind, lapply(x[-1], sapply, switch, '1' =
c(1,1), '2' = c(1, 2), '3' = c(2, 2)))))
On Tue, Nov 24, 2009 at 1:51 PM, Lisaj <lisajca at gmail.com> wrote: