Currently, I have data that is in the following format (note, this is 1 column, 4 rows of the matrix):
aa|bb bb|cc|ee|ee cc cc|ee
and I want it to be displayed so that the column names are: aa, bb, cc, dd and ee. And I want there to be 4 lines, each line counts the number of lines that each line was present in the corresponding line 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 just gets ugly and complicated. Any help would be greatly appreciated.
Thanks in advance.
source share