I currently have data that is structured in the following way
ID, Question, Answer
abc, 123, 1,
abc, 456, 2,
abc, 789, 1,
abc, 000, 4,
def, 123, 2,
def, 456, 3,
def, 789, 1,
def, 000, 2,
I would like to convert it into a table format as follows
123 456 789 000
abc 1 2 1 4
def 2 3 1 2
Basically with the ID
as rows and the Question
as columns.
What would be the most effective R code to achieve this?