I have a file like this
group1 group2 group3 group4 ax as we aw as we rt ty aw aq yu pl aq qw oo se
I need to count unique (pairwise) one and save as a matrix form like this
group1 group2 group3 group4 group1 4 2 0 1 group2 2 4 1 0 group3 0 1 4 0 group4 1 0 0 4
I used R intersect function for this but I could not able to save the output as a matrix form.