I want to apply the cast() function to this df. In the df there are 2081 different unique 'Variables'. I do not know how to get each of them to be a column with its 'Value' as the content of that column. Also, the seasons are from 2010 - 2018, so there are multiple copies of "Player.Name". Any help is greatly appreciated.
Thank you
Player.Name Season Variable Value
<fctr> <int> <fctr> <fctr>
1 Robert Garrigus 2010 Driving Distance - (ROUNDS) 71
2 Bubba Watson 2010 Driving Distance - (ROUNDS) 77
3 Dustin Johnson 2010 Driving Distance - (ROUNDS) 83
4 Brett Wetterich 2010 Driving Distance - (ROUNDS) 54
5 J.B. Holmes 2010 Driving Distance - (ROUNDS) 100
6 John Daly 2010 Driving Distance - (ROUNDS) 63
...