Condense matrix of values into one column?
I have a dataset where I have unnecessarily duplicated column variables that I want to condense down. I wish the output wasn't so clumsy and I've already had to do some work to transform it and make it easier to manage. I'm familiar with basic R stuff but not an expert by any means so please be patient!
Each R(1-10) corresponds to a response rating for the question (q1-10). The questions are randomised in order for each trial for each participant, so the qnum doesn't refer to the same question every time. I want to condense the matrix of response ratings down so that there is a single column called 'response' which reflects the rating given by the participant for each qnum for each trialNumber, so I don't have unnecessarily repeated tokens! Essentially going down the diagonal and reshaping it into one column. How can I do this?
Topic transformation reshape r
Category Data Science