Hi,
I'm trying to perform the above-mentioned task on a large data set of 1.5 million observations of 52 variables. I've provided a small sample of the data to illustrate what I'm trying to achieve. The variables which remain the same for each personal id number are Gender and Status but I'd like the other variables to be spread out so that each row shows all information for each individual.
df_Long <- data.frame(Personal_ID_Number = c(1,1,1,2,2,2,3,3,3),
Gender = c(0,0,0,1,1,1,0,0,0),
Status = c("A","A","A","C","C","C","B","B","B"),
Acct.Type = c("RSV","RSV","STM","FLX","RSV","STM","STM","FLX","RSV"),
Desc = c("Prim","Prim","Sec","Joint","Sec","Prim","Sec","Prim","Joint"),
Currency = c("JMD","JMD","GBP","USD","GBP","JMD","GBP","JMD","USD"),
Bal_1 = c(5000,5500,3000,6000,5000,4000,7000,6000,5000),
Bal_2 = c(4000,5000,5500,6500,7500,8500,9500,2500,1500))
Please assist if you can.
Cheers!
DA