I am coming back to R after a year and want to use rpart for a classification tree.
My data looks like:
Category, Shape, Color, Yes, No
A, Square, Blue, 3, 2
B, Triangle, Blue, 2, 4
etc.
Any recommendations to reshape into the below so I can use rpart? (I believe rpart needs the data as such)
ID, Shape, Color, Result
A, Square, Blue, Yes
A, Square, Blue, Yes
A, Square, Blue, Yes
A, Square, Blue, No
A, Square, Blue, No
B, Triangle, Green, Yes
etc...
Thank you!