Suppose I have a table arranged as follows:
Movie ID User ID
12 123
13 421
17 908
. .
. .
. .
and I want to arrange the table as follows;
User ID|Movie ID:12 13 17 . . . 671
123 1 1 1 0
421 1 1 1 0
908 1 1 1 0
Is there an easy way I can do this in R or do i have to write custom code? I want the values to be either 1/0 depending if the user watched the movie.