I'm using R and I have a column that looks like this:
relative
aunt
mother,grandmother
sister,mother
My desired outcome should look like this:
mother sister aunt grandmother
0 0 1 0
1 0 0 1
0 0 0 0
1 1 0 0
How can I do that? Thanks in advance.
You can do:
or (for integers):