I have a df in the following form:
id sid steps
A 1 step1
A 1 step1-step2
A 1 step1-step2-step3
This contains data of how a user A went through a certain series of pages (steps) in a given session (sid). I want to take these dash delimitated steps and create individual columns for every step.
Result:
id sid steps page_step1 page_step2 page_step3
A 1 step1 step1 NA NA
A 1 step1-step2 step1 step2 NA
A 1 step1-step2-step3 step1 step2 step3
I don't know exactly how many steps so I was hoping that they're created dynamically. Been stuck on this all week, thanks!