I have a dataset like so:
Name | Pet | isTrain |
---------------------------------
Ben | Dog | 1 |
Kim | Cat | 0 |
Kim | Rabbit | 0 |
How do I make this into a matrix in R where the Name is the row and the Pet is the column, and isTrain is the value?