hi I am new to r programming I just can't figure out an answer to a problem like I want to change the 2nd column into rows based on the 1st one i.e my datafile looks like
article user
1 u1
1 u2
1 u3
2 u2
2 u4
2 u5
3 u1
3 u6
3 u4
3 u7
so what I want is to form a matrix with rows is the article and column is all user like e.g.
article u1 u2 u3 u4 u5 u6 u7
1 1 1 1 0 0 0 0
2 0 1 0 1 1 0 0
3 1 0 0 1 0 1 1
thanks for your help in advance.