Since all the previous questions I could find about unpivoting a dataframe refered to numeric data, I still haven't found how to proceed with the following.
Let's say I have a Dataframe set up as follows:
+--------+--------+--------+-------+
| Level1 | Level2 | Level3 | Props |
+--------+--------+--------+-------+
| A | A | C | X,Y |
+--------+--------+--------+-------+
| A | B | C | Y,Z |
+--------+--------+--------+-------+
| D | E | F | Y,Z |
+--------+--------+--------+-------+
| G | H | I | X,Z |
+--------+--------+--------+-------+
And I would like to get that:
+--------+--------+--------+---+---+---+
| Level1 | Level2 | Level3 | X | Y | Z |
+--------+--------+--------+---+---+---+
| A | A | C | 1 | 1 | 0 |
+--------+--------+--------+---+---+---+
| A | B | C | 0 | 1 | 1 |
+--------+--------+--------+---+---+---+
| D | E | F | 0 | 1 | 1 |
+--------+--------+--------+---+---+---+
| G | H | I | 1 | 0 | 1 |
+--------+--------+--------+---+---+---+
How could I do this?
Thanks!
R.