I currently have data that is in the following format (note, this is 1 column, 4 row matrix):
aa|bb
bb|cc|ee|ee
cc
cc|ee
and I want it displayed so that the column names are: aa, bb, cc, dd, and ee. And I want there to be 4 row such that each row counts the number of times each string was present in the matching row above.
ie)
aa bb cc dd ee
1 1 0 0 0
0 1 1 0 2
0 0 1 0 0
0 0 1 0 1
Does anyone know how to do this in R? I would post my attempt, but it is just getting ugly and complicated. Any help would be much appreciated.
Thanks in advance.