I have dataset with the following format. I was trying to do that with reshape2 package in R, but it gives an inappropriate format(binary variables for all pages). Is there any method available that can reshape the data set in the required format as below.
Input format:
User Pages
1 index.html
1 search.html
1 help.html
1 contact.html
2 help.html
2 contact.html
3 index.html
3 search.html
3 feedback.html
Output format:
User page1 page2 page3 page4 page5
1 index.html search.html help.html contact.html NA
2 help.html contact.html NA NA NA
3 index.html search.html feedback.html NA NA
aggregatefunction, with which you can condense your "Pages" variable into a list by user. Something likeaggregate(as.character(Pages) ~ User, mydf, I, simplify = FALSE), where "mydf" is the name of your dataset.