Skip to content
Prev 201530 / 398506 Next

reshape question

Or

library(reshape)
df <- melt(data.out2, na.rm = T, id = "id")
df <- cbind(df, colsplit(df$variable, "\\.", c("var", "time")))

cast(df, id + time ~ var)

See http://had.co.nz/reshape for more details.

Hadley