Create a binary indicator matrix in R
- by Brian Vanover
I have a list of data indicating attendance to conferences like this:
Event Participant
ConferenceA John
ConferenceA Joe
ConferenceA Mary
ConferenceB John
ConferenceB Ted
ConferenceC Jessica
I would like to create a binary indicator attendance matrix of the following format:
Event John Joe Mary Ted Jessica
ConferenceA 1 1 1 0 0
ConferenceB 1 0 0 1 0
ConferenceC 0 0 0 0 1
Is there a way to do this in R? Sorry for the poor formatting.