I want to make new columns, based on the values of a single existing column. It is event data (from a website), so the number of values are different. Just like this:
row Events
1 237,2,236,102,106,111,114,115,116,117,118,119,125
2 237,111,116
3 102,106,111,114,115
4 237,2,236,102,106,111,114,115,116,117,118,119,125, 126
The result should be dummy data, based on the different values.
row 237 2 236 102 106 111 114 115 116 117 118 119 125 126
1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
2 1 0 0 0 0 1 0 0 1 0 0 0 0 0
3 0 0 0 1 1 1 1 1 0 0 0 0 0 0
4 0 0 0 1 1 1 1 1 0 0 0 0 0 1
I tried to solve this with the tidyr separate function, in combination with the function "createDummyFeatures" (MLR package). But, I had to name the columns manually (and ideally it should take the name of the value, just as in the example).