Using R's separate function I'm trying to seprate a column into new columns everytime a digit increases. Column is set up like so: Q1_W1 Q1_W2 Q2_W1 Q2_W2 Q3_W1 And so on until it ends with Q9. The desire is to seperate the groups splitting on Q1, Q2, Q3, and so forth.
what I have tried so far is only filling Q1.
nn3=nalhx%>%
separate(q, into =c("Q1","Q2","Q3","Q4","Q5","Q6","Q7","Q8","Q9"), sep = "(^q+[0-9])")
Desired output: https://i.stack.imgur.com/u0r4Z.png