Data is in this form:
df1<-data.frame(index=c(1,2,4,6,8), drive=c("low_and_high","low_and_high_2)
index drive
1 1 low_and_high
2 2 low_and_high_2
3 4 low_and_high
4 6 low_and_high_2
by using some function I want to generate this output:
index drive_1 drive_2
1 1 low high
2 2 low high_2
3 4 low high
4 6 low high_2
Thanks in Advance!