Skip to content
Prev 247883 / 398503 Next

How to reshape wide format data.frame to long format?

As for your second question, you could certainly do

newcodesM = transform(newcodesM, variable1 = unlist(strsplit(variable,'\\.'))[1], variable2 = unlist(strsplit(variable, '\\.'))[2], variable3 = unlist(strsplit(variable,'\\.'))[3])

though I'm sure there is a more efficient use of strsplit in this context. 

Abhijit
On Jan 20, 2011, at 10:51 AM, Fredrik Karlsson wrote: