I have a csv file that contains a really weird table that I want to format in a proper way.
The Background: Students are able to answer questions on an online platform. The questions are labeled Test1, Test2, Test3. The three questions are presented as packs, but the order of questions is randomized. It can be Test1, Test2, Test3 or Test2, Test3, Test1 etc.
I can download the results in a csv file. If I put the results to a dataframe, it looks like this.
What I need for an analysis of the results is the following format:
I was thinking about localising each occurrence of "Name" in the first column to cut the dataframe into single data frames, where each dataframe represents one student, like this:
For StudentB, I could just rearrange the columns, so it looks like
I could then remove the column descriptions of every student that is ordered as StudentB and put them back together, giving me
Although I am a R Beginner, im pretty confident I could find a way to do that, BUT how can I reorder StudentA?
So my first question: Which is a better way to do this? Second question: What about students that answered multiple tests?
Best regards!