I would like to use R to produce a relationship matrix from a list of known relations.
For example, with the following dataset :
John Green
Mary Blue
Mary Red
John Blue
I would like to have :
Green Blue Red
John 1 1 0
Mary 0 1 1
I didn’t found how to do this.
Thanks in advance for any suggestion.
You can use
table.