I have some data in excel sheet which looks like the following:
User | Query
u1 | q3
u2 | q7
u2 | q7
u3 | q1
u3 | q10
u3 | q8
u4 | q9
u4 | q2
Now I want to cover this data into matrix like:
q1 q2 q3 q7 q8 q9 q10
u1 0 0 1 0 0 0 0
u2 0 0 0 2 0 0 0
u3 1 0 0 0 1 0 1
u4 0 1 0 0 0 1 0
I don't know what is the name of this sort of matrix but I want to make graph from this matrix. So is there any way to get the matrix from the list mentioned above using any either "R" or "excel?