Dear R experts,
I have the data in the following fomat(from some kind of card sorting process)
 
ID  Category   Card numbers
1   1               1,2,5
1   2               3,4
2   1               1,2
2   2               3
2   3               4,5
 
I want to transform this data into two co-occurence matrix (one for each ID)
-- For ID 1
   1 2 3 4 5
1 1 1 0 0 1
2 1 1 0 0 1
3 0 0 1 1 0
4 0 0 1 1 0
5 1 1 0 0 1
 
-- For ID 2
   1 2 3 4 5
1  1 1 0 0 0
2  1 1 0 0 0
3  0 0 1 0 0 
4  0 0 0 1 1
5  0 0 0 1 1
 
The columns and rows are representing the card numbers. All "0"s mean the card 
numbers are not in the same category, vice versa.
 
Is there any way I can to this in R?
I would really appreciate your help. 
 
Judie, Tie
 
 

                
---------------------------------


        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to