I have a R dataFrame that contains the following:
column1 column2
score1...test1 10
score2...test2 11
score3...test3 15
I would like to reshape my dataFrame into the following:
column1 column2 score test
score1...test1 10 score1 test1
score1...test2 11 score2 test2
score1...test3 15 score3 test3
I tried to use
library(stringr)
temp=str_split_fixed(df, " ...", 4)
but I am getting this
[,1] [,2] [,3] [,4]
How can tackle this problem?