I have a list that looks like this:
>AP
$CMP1
[1] 411050384 411050456 411050456 411058568
$CMP2
[1] 411050384 411050456
$CMP3
[1] 411050384 411050456 411058568 428909002 428909002
And I want to transform the list into a data frame that uses every unique entry as a column name, and the entries in the data frame are frequency counts for each member of the list "CMP". This is what I want the data frame to look like.
411050384 411050456 411058568 428909002
CMP1 1 2 1 0
CMP2 1 1 0 0
CMP3 1 1 1 2
I have looked though the documentation for the 'plyr' and 'reshape2' packages, and I have not had any luck. Any help is appreciated. Thanks.
What about this?