PD0_Code PD0_Flock PD0_Tag PD0_Value PD1_Code PD1_Flock PD1_Tag PD1_Value PD2_Code PD2_Flock PD2_Tag PD2_Value
Hi I have a data table that contains 384 columns. I need it transformed from wide into long format. I cannot use melt or split/stack as the column headers are different. Above is the format of column headers I am dealing with. What I need is the large dt split into 4 columns (Code, Flock, Tag, Value) and then stacked on top of each other. I have tried the following and it splits it correctly - now I just need to be able to stack it all together
split(dt2, (seq_along(4)))
x <- cbind(obj.list)
I would really appreciate some help with this. Thanks